I have a UserDataDB created that I cant get a connection. I can get a connect to another file in the same folder as UserDataDB. Any ideas as to why this folder does not work and the other ones do?
<code> try{
Connection con = DriverManager.getConnection("jdbc:derby:C:\Program Files\Java\jdk-22\db\UserDataDB; create=true;");
System.out.println("Good connections. ");
con.close();
}catch (Exception e){
System.out.println(e.getMessage());
}
</code>
<code> try{
Connection con = DriverManager.getConnection("jdbc:derby:C:\Program Files\Java\jdk-22\db\UserDataDB; create=true;");
System.out.println("Good connections. ");
con.close();
}catch (Exception e){
System.out.println(e.getMessage());
}
</code>
try{
Connection con = DriverManager.getConnection("jdbc:derby:C:\Program Files\Java\jdk-22\db\UserDataDB; create=true;");
System.out.println("Good connections. ");
con.close();
}catch (Exception e){
System.out.println(e.getMessage());
}
error:
XJ040.C : [0] C:Program FilesJavajdk-22dbUserDataDB, [1] jdk.internal.loader.ClassLoaders$AppClassLoader@4fca772d
- I replace the path with “jdbc:derby:C:Program FilesJavajdk-22dbbinUserDataDB; create=true;” and this worked, creating a folder in the ..bin folder.
- “jdbc:derby:C:Program FilesJavajdk-22dbtestDb;” connect fine which is in the same folder