javaderbynetbeans-platformnetbeans-7.4

Schema "DB" Doesn't exist


I use the following code to create db connection

public final static String driver = "org.apache.derby.jdbc.ClientDriver";
public final static String connectionURL = "jdbc:derby:projectDB;create=true;user=user1;password=psssword";

public CreateConnectionDOA(String driver, String connectionURL) throws ClassNotFoundException,SQLException
    {
            Class.forName(driver);
            conn = DriverManager.getConnection(connectionURL);
            conn.setAutoCommit(false);
    }

The project was created in Netbeans-Platform-Application-Module. When i run the project through netbeans platform 7.4.. it works properly.

But when i try to create a installer using netbeans and run.. the project opens but it also gives an exception

"ERROR 42Y07: Schema 'projectDB' does not exist


Solution

  • try fully pathing your DB in your url

    public final static String connectionURL = 
    "jdbc:derby:d:/myproject/projectDB;create=true;user=user1;password=psssword";