0

I am writing one jdbc program where I got this problem:name is already used by existing object.

 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");

Error I am getting when I am running this program.

  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)
4
  • It appears the table emp4090 already exists. Commented Nov 11, 2013 at 0:11
  • See Oracle/PLSQL: ORA-00995 Error. Commented Nov 11, 2013 at 0:15
  • I have already check this option dropping the table name but it is not working. Commented Nov 11, 2013 at 0:24
  • Why don't you just do this in sqlplus? You say you can't drop the table, but don't show the error. Commented Nov 11, 2013 at 1:15

1 Answer 1

1

Its simple, when you create the table once you cannot create her in the second time. try to drop the table and then to recreate it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.