users@glassfish.java.net

Unable to connect to JavaDB

From: <glassfish_at_javadesktop.org>
Date: Sat, 28 Mar 2009 02:21:42 PDT

Hello. I am writing a web application, which part of it requires authentication. The application has to connect to JavaDB and get encrypted password to check against user-entered password. However, it seems my web application cannot connect to JavaDB.

I created the database in NetBeans, with name [i]JNewsReader[/i]. I put the following 2 lines in my code:

// Load JavaDB driver
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
// Connect to JavaDB
connection = DriverManager.getConnection("jdbc:derby://localhost:1527/JNewsReader;user=myname;password=mypass");

Is there any mistakes in my code? I read the log in GlassFish, and I think my web application cannot connect to the database.

Thanks for your help.
[Message sent by forum member 'graphitecube' (graphitecube)]

http://forums.java.net/jive/thread.jspa?messageID=339432