title: Derby Data Base Updation through java?
body: <p><strong>I had this code copied from the net and made some required changes, for my data base</strong></p>
  
  <pre><code>public class MainClass {
  </code></pre>
  
  <p>static Connection conn;</p>
  
  <p>public static void main(String[] args) throws Exception {
      if (args.length != 2) {
        System.out.println("Usage: java JavaDBDemo  ");
        System.exit(1);
      }</p>
  
  <pre><code>String driver = "org.apache.derby.jdbc.EmbeddedDriver";
  String dbName = "JeeteshBD";
  String connectionURL = "jdbc:derby:" + dbName + ";";
  String createString = "CREATE TABLE SANKYA.ADDRESS (NAME VARCHAR(32) NOT NULL, ADDRESS VARCHAR(50) NOT NULL)";
  Class.forName(driver);
  
  conn = DriverManager.getConnection(connectionURL);
  
  Statement stmt = conn.createStatement();
  stmt.setPoolable(true);
  stmt.execute(createString);
  
  
  PreparedStatement psInsert = conn
      .prepareStatement("insert into SANKYA.ADDRESS values (?,?)");
  
  psInsert.setString(1, args[0]);
  psInsert.setString(2, args[1]);
  
  psInsert.executeUpdate();
  
  Statement stmt2 = conn.createStatement();
  ResultSet rs = stmt2.executeQuery("select * from SANKYA.ADDRESS");
  System.out.println("Addressed present in your Address Book\n\n");
  int num = 0;
  
  while (rs.next()) {
    System.out.println(++num + ": Name: " + rs.getString(1) + "\n Address"
        + rs.getString(2));
  }
  rs.close();
  </code></pre>
  
  <p>}
  }</p>
  
  <p><strong>After executing the following code I get following error in the console.</strong></p>
  
  <pre><code>Exception in thread "main" java.sql.SQLException: Table/View 'ADDRESS' already exists in Schema 'SANKYA'.
  at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
  at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
  at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
  at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
  at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
  at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
  at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
  at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
  at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
  at MainClass.main(MainClass.java:26)
  </code></pre>
  
  <p>Caused by: java.sql.SQLException: Table/View 'ADDRESS' already exists in Schema 'SANKYA'.
      at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
      ... 10 more
  Caused by: ERROR X0Y32: Table/View 'ADDRESS' already exists in Schema 'SANKYA'.
      at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
      at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.duplicateDescriptorException(Unknown Source)
      at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addDescriptor(Unknown Source)
      at org.apache.derby.impl.sql.execute.CreateTableConstantAction.executeConstantAction(Unknown Source)
      at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
      at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
      at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
      ... 4 more</p>
  
  <p><strong>But when i look at the data base perspective in Eclipse, the updation is not done, can anyone throw some light upon this?</strong></p>
  
  <p><strong>This is a derby.log that is created on the desktop</strong></p>
  
  <pre><code>----------------------------------------------------------------
  </code></pre>
  
  <p>2013-03-11 05:10:17.241 GMT:
   Booting Derby version The Apache Software Foundation - Apache Derby - 10.5.1.1 - (764942): instance c013800d-013d-57db-3673-0000018a21b0
  on database directory /home/sankya/JeeteshBD  </p>
  
  <p>Database Class Loader started - derby.database.classpath=''</p>
  
  <p>2013-03-11 05:10:17.639 GMT:</p>
  
  <h2>Shutting down instance c013800d-013d-57db-3673-0000018a21b0</h2>
  
  <hr>
  
  <p>2013-03-11 05:10:27.773 GMT:
   Booting Derby version The Apache Software Foundation - Apache Derby - 10.5.1.1 - (764942): instance a816c00e-013d-57db-3673-0000018a21b0
  on database directory /home/sankya/JeeteshBD  </p>
  
  <p>Database Class Loader started - derby.database.classpath=''</p>
  
  <p>2013-03-11 06:22:45.639 GMT:</p>
  
  <h2>Shutting down instance a816c00e-013d-57db-3673-0000018a21b0</h2>