JDBC和JTDS批量插入SQL SERVER数据每次到3千条是就出现提示说端口错误,或连接占用
Network error
IOException: Address already in use: connect(JTDS)
------解决方案--------------------PreparedStatement ins=con.prepareStatement(sql);
for (int i=0;i <100000;i++)
{
//循环为PreparedStatement中的参数赋值
ins.setString(k+1,msg[i][k]);
ins.addBatch();
}
ins.executeBatch();