LAB-3400: Java EE 5 Basics - problem with connection to database

30 views
Skip to first unread message

andy

unread,
Sep 13, 2007, 6:59:34 PM9/13/07
to Java EE (J2EE) Programming with Passion!
Hi guys,


I am doing the Exercise 3 and having a problem with conection to the
"jdbc:derby://localhost:1527/sample [app on APP]" database.
I have got the following message: "Unable to connect, cannot establish
contection to jdbs:derby://localhost:1527/sample using
org.apache.derby.jdbc.ClientDriver (Unable to find suitable driver)".

During this exercise the "Java DB server" was running.

I use the NetBeans 5.5.1 (recently upgraded from 5.0) and the Sun
Application Server 9.

Can you help me guys with this?
Maybe my settings became wrong during the NetBeans upgrade process.
Do you know where can I set the proper driver ?

Thanks

Andy

Jefferson S.J. Gan

unread,
Sep 13, 2007, 8:56:23 PM9/13/07
to java-ee-j2ee-progr...@googlegroups.com
Be sure you have added the derbyclient.jar in your list of jars in your classpath.

Regards,
   Jeff

andy

unread,
Sep 14, 2007, 8:10:57 AM9/14/07
to Java EE (J2EE) Programming with Passion!
I have checked this and I have the following files in my classpath for
Java DB Driver:
C:\Sun\AppServer\javadb\lib\derbyclient.jar
C:\Sun\AppServer\javadb\lib\derby.jar
C:\Sun\AppServer\javadb\lib\derbynet.jar

I still can not connect to database and get the same message.

Thanks Jeff anyway.

On Sep 14, 1:56 am, "Jefferson S.J. Gan" <jefferson....@gmail.com>
wrote:


> Be sure you have added the derbyclient.jar in your list of jars in your
> classpath.
>
> Regards,
> Jeff
>

luigi hernandez

unread,
Sep 14, 2007, 5:02:43 PM9/14/07
to asil...@yahoo.com, Java EE (J2EE) Programming with Passion!
TAMBIEN VERIFICA LOS ARCHIVOS
tu jndi
sun-web.xml

<sun-web-app error-url="">

<context-root>/DeintecWEB</context-root>

<resource-ref>

<res-ref-name>condeintec</res-ref-name>

<jndi-name>condeintec</jndi-name>

</resource-ref>

<class-loader delegate="true"/>

 
 
web.xml
 
 <resource-ref>
        <description>jdbc:mysql://localhost:3306/zebra_dbo</description>
        <res-ref-name>condeintec</res-ref-name>
        <res-type>javax.sql.DataSource </res-type>
        <res-auth>Container</res-auth>
        <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
 
okass

 
2007/9/14, andy <asil...@yahoo.com>:
Solucionenred.com
Atzayacatl  Mz.29 Lt.20 Col.Adolfo Ruiz Cortinez
Tels: 1517-6165  Movil:0445528896306

Victor Ott

unread,
Sep 15, 2007, 3:26:26 AM9/15/07
to Java EE (J2EE) Programming with Passion!
Is it now

jdbc:derby: OK

or

jdbs:derby: WRONG

you're using as DB URL prefix? From the error message it's the second one...

Reply all
Reply to author
Forward
0 new messages