users@glassfish.java.net

Re: Unable to connect to JavaDB

From: Mujahid Mohamed <ajmujaa_at_gmail.com>
Date: Sat, 28 Mar 2009 16:56:45 +0600

just try to put this code

Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();

On Sat, Mar 28, 2009 at 3:21 PM, <glassfish_at_javadesktop.org> wrote:

> 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
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>


-- 
***********************
A J M Mujahid
(SCJP, SCWCD, AJD)
Phone: 0771298540
Email: ajmujaa_at_gmail.com
***********************