我正在开发一个应用程序,用MySQL在MySQL中创建脚本。
该过程大约需要20分钟,并创建640个包含主键和外键的表(没有数据)。
这是创建表格的代码
st=conexion.createStatement();
for(StringBuilder sentencia:sentencias){
try{
st.executeUpdate(sentencia.toString());
}catch(Exception e){
errores.add(sentencia);
}
}
有人可以帮我优化代码吗?我正在使用隔离级别事务和线程。