On 6/20/13 4:08 PM, Geetha Attili wrote:
Hi ,
I am trying to connect to a JavaDB Database on Classpath , I tried various things as given in the doc, but I feel the behaviour is very inconsistent or may be I am doing some silly mistake.

In a Command prompt
> cd D:\DerbyDemo
>ij
ij version 10.8
//created a sample database jdb_classpath
ij>connect 'jdbc:derby:jdb_classpath;create=true;';
//created a sample Table
ij>create table mytable(id numeric);
//Disconnected from the jdb_classpath database
ij>disconnect;


I have then Set the Classpath to include D:\DerbyDemo ;
Opened a new command prompt
>ij
 tried connecting to the jdb_classpath using the following syntax
ij>connect 'jdbc:derby:/jdb_classpath';

ERROR XJ004: Database '/jdb_classpath' not found.

As per the Doc <http://docs.oracle.com/javadb/10.8.1.2/devguide/rdevdvlp22102.html> as in example, this should have worked
"

    * /jdbc:derby:/myDB/

      Access /myDB/ (which is directly in a directory in the
      classpath) as a read-only database.

      "


ij>connect 'jdbc:derby:classpath:jdb_classpath';
Connection successful. there is no other database with the same name in the classpath .
Do I have to use the classpath  subprotocol always?

Many Thanks in Advance,
Geetha
Hi Geetha,

You are reading the 10.8 docs. The documentation in this area was cleaned up in later releases. The failing example was removed from that topic in the Developer's Guide. Please consult the corresponding topic in the 10.10 version of the Developer's Guide: http://db.apache.org/derby/docs/10.10/devguide/index.html

Hope this helps,
-Rick

Reply via email to