Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2006
    Posts
    21

    Exclamation Unanswered: java.sql.SQLException: ORA-00955 name is already used by an existing object

    hi I'm getting this error i'm a little bit new to java and a lot stuck with this.. can someone tell me whats going wrong is this a Java program error or is this an Oracle error... thanx in advanced

    java.sql.SQLException: ORA-00955: name is already used by an existing object

    at oracle.jdbc.driver.DatabaseError.throwSqlException (DatabaseError.java:111)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoe r.java:330)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoe r.java:287)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java: 742)
    at oracle.jdbc.driver.T4CStatement.doOall8(T4CStateme nt.java:206)
    at oracle.jdbc.driver.T4CStatement.executeForRows(T4C Statement.java:945)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTi meout(OracleStatement.java:1159)
    at oracle.jdbc.driver.OracleStatement.executeUpdateIn ternal(OracleStatement.java:1605)
    at oracle.jdbc.driver.OracleStatement.executeUpdate(O racleStatement.java:1570)
    at MainClass.main(MainClass.java:26)

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    You want assistance debugging your code but you decide we don't need to see the code to assist.

    >ORA-00955: name is already used by an existing object

    I suspect you are issuing a CREATE statement & the object already exists.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Mar 2006
    Posts
    21
    My bad... i don't know what i was thinking... here is my code..
    i've been trying to change table names since the error states that the object is already created i thought that this might have been a table name so i changed employee to TestEmployees but it tells me that error...

    import java.sql.Connection;
    import java.sql.Statement;
    import java.sql.DriverManager;
    import java.sql.SQLException;

    public class MainClass {

    private static final String Make = "create table TestEmployees ( " + " id INT PRIMARY KEY, firstName VARCHAR(20), lastName VARCHAR(20), " + " title VARCHAR(20), salary INT " + ")";

    public static Connection getConnection() throws ClassNotFoundException, SQLException {
    String driver = "oracle.jdbc.driver.OracleDriver";
    String url = "jdbcracle:thin:@w2vz2dtt02.amer.corp.eds.com:1521:test ";
    String username = "system";
    String password = "e9876";
    Class.forName(driver);
    Connection conn = DriverManager.getConnection(url, username, password);
    return conn;
    }

    public static void main(String args[]) {
    Connection conn = null;
    Statement stmt = null;
    try {
    conn = getConnection();
    stmt = conn.createStatement();
    stmt.executeUpdate(Make);
    stmt.executeUpdate("insert into TestEmployees(id, firstName) values(100, 'A')");
    stmt.executeUpdate("insert into TestEmployees(id, firstName) values(200, 'B')");
    System.out.println("CreateEmployeeTableOracle: main(): table created.");
    }
    catch (ClassNotFoundException e) {
    System.out.println("error: failed to load Oracle driver.");
    e.printStackTrace();
    }
    catch (SQLException e) {
    System.out.println("error: failed to create a connection object.");
    e.printStackTrace();
    }
    catch (Exception e) {
    System.out.println("other error:");
    e.printStackTrace();
    }
    finally {
    try
    {
    stmt.close();
    conn.close();
    }
    catch (Exception e) {
    }
    }
    }
    }

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >I'm getting this error i'm a little bit new to java
    Are you new to Oracle, too?

    Does table TestEmployees exist when you run the Java program?
    If so, an error will be thrown.

    The only advice is to ensure that TestEmployees does not exist before running the Java program.
    Last edited by anacedent; 06-15-08 at 22:50.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •