//执行数据DDL脚本
package cn.iszt.test.services;
import java.sql.SQLException;
import java.sql.Statement;
import cn.iszt.test.model.SqlModel;
public class SqlDDL extends JDBC {
public static String sql;
public SqlModel sqlget(SqlModel sqlmodel) throws Exception {
sql = sqlmodel.getsql();
Statement stmt = null;
//
System.out.println(sql);
//
try {
stmt = (Statement) conn.createStatement();
} catch (SQLException e) {
e.printStackTrace();
}
try {
stmt.executeUpdate(sql);
System.out.println();
} catch (SQLException e) {
e.printStackTrace();
}
return sqlmodel;
}
}
package cn.iszt.test.services;
import java.sql.SQLException;
import java.sql.Statement;
import cn.iszt.test.model.SqlModel;
public class SqlDDL extends JDBC {
public static String sql;
public SqlModel sqlget(SqlModel sqlmodel) throws Exception {
sql = sqlmodel.getsql();
Statement stmt = null;
//
System.out.println(sql);
//
try {
stmt = (Statement) conn.createStatement();
} catch (SQLException e) {
e.printStackTrace();
}
try {
stmt.executeUpdate(sql);
System.out.println();
} catch (SQLException e) {
e.printStackTrace();
}
return sqlmodel;
}
}