使用JDBC在MySQL中更快地执行create table

时间:2016-07-29 21:13:51

标签: java mysql jdbc

我正在开发一个应用程序,用MySQL在MySQL中创建脚本。

该过程大约需要20分钟,并创建640个包含主键和外键的表(没有数据)。

这是创建表格的代码

st=conexion.createStatement();
for(StringBuilder sentencia:sentencias){
    try{
         st.executeUpdate(sentencia.toString());
        }catch(Exception e){
            errores.add(sentencia);
        }
  }

有人可以帮我优化代码吗?我正在使用隔离级别事务和线程。

0 个答案:

没有答案