急,帮帮忙
Connection conn = DriverManager.getConnection(
"jdbc:mysql://localhost/nie", "", "");
Statement stmt = conn.createStatement();
stmt.execute("create table net(nid int)");
for (int j=0; j<hobby.length; j++){
stmt.execute("alter table net add "+hobby[j]+" char(20)");
}
总是提示sql语法错误,为什么。就是"+hobby[j]+"(是个变量)有问题,不知道怎么办。