我正在编写一个遇到此问题的 jdbc 程序:名称已被现有对象使用。
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
}
catch(ClassNotFoundException ex)
{
ex.printStackTrace();
}
Connection con=null;
Statement stmt=null;
con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","system","moon");
stmt=con.createStatement();
stmt.execute("create table emp4090(eno int,ename varchar(20))");
System.out.println("Done successfully");
运行此程序时出现错误。
Exception in thread "main" java.sql.SQLException: ORA-00955: name is already used by an existing object
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:207)
at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:946)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1169)
at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1688)
at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1654)
at com.aol.jdbc.Jdbc.main(Jdbc.java:26)