I am working on a desktop application that uses JavaDB. I am using NetBeans 6.8 and JDK 6 Update 20
I created the database I needed and connected to it through my application using ClientDriver :
String driver = "org.apache.derby.jdbc.ClientDriver"; String connectionURL = "jdbc:derby://localhost:1527/myDB;create=true;user=user;password=pass"; try { Class.forName(driver); } catch (java.lang.ClassNotFoundException e) { e.printStackTrace(); } try { schedoDBConnection = DriverManager.getConnection(connectionURL); } catch (Exception e) { e.printStackTrace(); }
It works great. But in this case, the database service comes from NetBeans. If I transfer the application to another computer, I will not be able to access my database. How can I integrate my JavaDB into my application?
source share