db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Hillegas <Richard.Hille...@Sun.COM>
Subject Re: Derby Stored Procedure Help!
Date Tue, 14 Apr 2009 14:23:47 GMT
sivagururaja wrote:
> Rick Hillegas-2 wrote:
>   
>> Hello,
>>
>> This is just the special string ("jdbc:default:connection") which tells 
>> the DriverManager that your code is running inside a server session and 
>> wants to get a handle on that session. A session has two pieces: 1) an 
>> external piece which is visible to your application (this is the 
>> Connection), and 2) an internal piece which is only visible inside 
>> Derby. The two pieces talk to one another either via method calls (in 
>> the embedded case) or over a network protocol (in the remote case). When 
>> your database procedure is actually running inside Derby, you no longer 
>> have a handle on the external piece. If you want to issue SQL statements 
>> from inside a database procedure, then you need a special, thin wrapper 
>> around (2). This thin wrapper is what I mean by the "server-side 
>> connection".
>>
>> Hope this helps,
>> -Rick
>>
>>     
>
> Thank you Mr.Rick,
>
> It's working fine. Thanks a lot once again. :handshake:
> And i have one more doubt. I'm using NetBeans 6.5 with Derby DB 10.4.2.1.
>
> I can able to use the following code without error,
> Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
> Connection Con1 =
> DriverManager.getConnection("jdbc:derby://localhost:1527/Test", "uname",
> "passwd");
>
> But if i try use like this, it throws "Database 'Test' is not found".
> Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
> Connection Con1 = DriverManager.getConnection("jdbc:derby:Test", "uname",
> "passwd");
>
> What could be the problem? 
>
>   
Hello,

The error means that a subdirectory named Test doesn't exist in the 
current directory of the application's VM. It appears that the VM 
running the server has a different current directory than the VM running 
your application. Another way around this mismatch is to use full 
absolute paths as your database names, rather than relative paths whose 
resolution relies on VM context.

Hope this helps,
-Rick

Mime
View raw message