db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kathey Marsden <kmarsdende...@sbcglobal.net>
Subject Re: Urgent Help Required : Accessing DB with Derby Net Server
Date Thu, 31 Mar 2005 21:18:01 GMT
Kapil Bajaj wrote:

>
> Hi All
>
> I am trying to read a table from Cloudscape Database using Derby Net
> Server through Java Program
>
> Every Time I run program I get the Error "No Suitable Driver"
>
> Here is portion from Java Program
>
> Connection connection = null;
>         Driver driver = null;
>         String s = "jdbc:derby:net://localhost:1527/TEST;";
>         try
>         {
>             driver =
> (Driver)Class.forName("com.ibm.db2.jcc.DB2Driver").newInstance();
>         }
>         catch(Exception exception)
>         {
>             System.out.println("1");
>             exception.printStackTrace();
>         }
>         try
>         {
>             DriverManager.registerDriver(driver);
>             connection = DriverManager.getConnection(s, "", "");
>         }
>         catch(Exception exception1)
>         {
>             System.out.println("2");
>             exception1.printStackTrace();
>         }
>
> I have made sure that db2jcc.jar is included in Classpath. I have not
> downloaded any jar File only used what is available in Cloudscape By
> Default.
>
> My Cloudscape Server is running and I wanted to take connection from
> running Server without Stopping Server. Also I am setting
> derby.system.home Property to location in C Drive using -D Option
> while running Java File. I am setting system.home Property to
> Directory where my database is residing.
>
> However if I use Embedded Driver DB2jDriver than my program works fine
> but I am getting Error with Network Server Mode.
>
> Please help me with this issue as this is really urgent.
>
> Thanks and Regards
> ------------------------------------------------------------------------------------------------------------------
> Kapil Bajaj


That final ";" shouldn't be there unless you are using client attributes.
e.g

"jdbc:derby:net://localhost:1527/TEST";
 
instead of
"jdbc:derby:net://localhost:1527/TEST;";


Mime
View raw message