【发布时间】:2014-04-21 13:26:03
【问题描述】:
我的代码有错误:
String sql = "CREATE USER ken IDENTIFIED BY 11;";
try {
Class.forName("oracle.jdbc.OracleDriver");
con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE", "system", "kenilyas");
System.out.println("1111111111111");
System.out.println("222222");
pst = con.prepareStatement(sql);
System.out.println("333333");
try {
System.out.println("333333");
pst.execute();
System.out.println("creating");
} catch (Exception e) {
JOptionPane.showMessageDialog(null, e);
}
} catch (Exception e) {
JOptionPane.showMessageDialog(null, e);
}
【问题讨论】:
-
有任何诊断信息(行号)吗?我猜
;可能会导致问题,因为 Oracle 驱动程序往往只支持查询中的一个语句。 -
它是的;这会导致问题。
-
@Caramiriel 是的,你是对的。简单的解决方案,但我在转向 SO 之前调试了 30 分钟。