I have written a java code for bulk insertion. I\'m using the copy command for importing and creating different connection objects for different tables, but while executing, the
Are you using a connection pool? Check if connections are closed properly in your code. This should be done in a try-finally block:
Connection connection = dataSource.getConnection();
try {
....
}
finally {
connection.close();
}
If you really need a large amount of connections, set the max_connections-property in postres accordingly.
Documentation