db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dag.Wan...@Sun.COM (Dag H. Wanvik)
Subject Re: Tomcat Derby JSP Help needed! please
Date Fri, 28 Nov 2008 21:25:03 GMT
teamderby <mikehmurray@gmail.com> writes:

> CLASSPATH=\
> Applications/apache-tomcat-6.0.18/lib/derbyclient.jar:\
:
> String driver = "org.apache.derby.jdbc.EmbeddedDriver";
> String dbName="/db";
> String connectionURL = "jdbc:derby://localhost:8080/" + dbName; 

You are attempting to use the the client driver, cf. the above URL
syntax, whereas your driver string contains the embedded driver's
name: "org.apache.derby.jdbc.EmbeddedDriver". Since this is not
present in your classpath (you need derby.jar for embedded Derby), you
see the error. The correct value for the client driver is

String driver = "org.apache.derby.jdbc.ClientDriver";

Hope this help.

Thanks,
Dag

> Connection conn = null;
> try{
>     Class.forName(driver);
> } catch(java.lang.ClassNotFoundException e) {
>     e.printStackTrace();
> 	out.println(e);
> }
> try {
>     conn = DriverManager.getConnection(connectionURL);
> 	out.println("CONNETED<br>"); 
>
>     //body of code to go here
>
> }  catch (Throwable e)  {   
>    out.println(e);
>    e.printStackTrace();
> } finally {
>     
> }
>
> %>
>
>
>
> This returns the error
>
> "java.sql.SQLException: No suitable driver"
>
>
> -- 
> View this message in context: http://www.nabble.com/Tomcat-Derby-JSP-Help-needed%21-please-tp20737019p20737019.html
> Sent from the Apache Derby Developers mailing list archive at Nabble.com.
>
>

-- 
Dag H. Wanvik, staff engineer
Sun Microsystems, Databases (JavaDB/Derby)
Haakon VII gt. 7b, N-7485 Trondheim, Norway
Tel: x43496/+47 73842196, Fax:  +47 73842101

Mime
View raw message