I'm getting an exception in my query for inserting data into my database, i am inserting a lot of data into my database around 15k lines. this is the exception message:
The driver was unable to create a connection due to an inability to establish the client portion of a socket.This is usually caused by a limit on the number of sockets imposed by the operating system. This limit is usually configurable.
my function for the insert query:
public static void insertObject(int modelId,float x,float y,float z,float rx,float ry,float rz){
try
{
con = DriverManager.getConnection(url, user, password);
String query = " insert into wastobjects (modelid,x,y,z,rx,ry,rz)"
+ " values (?, ?, ?, ?, ?, ?, ?)";
PreparedStatement preparedStmt = con.prepareStatement(query);
preparedStmt.setInt (1, modelId);
preparedStmt.setFloat (2, x);
preparedStmt.setFloat (3, y);
preparedStmt.setFloat (4, z);
preparedStmt.setFloat (5, rx);
preparedStmt.setFloat (6, ry);
preparedStmt.setFloat (7, rz);
preparedStmt.execute();
con.close();
}
catch (Exception e)
{
System.err.println("Got an exception!");
System.err.println(e.getMessage());
}
}