Hi Knut,

great, now it works! Thank you very much indeed!

Mirek

----- Original Message ----
From: Knut Anders Hatlen <[EMAIL PROTECTED]>
To: Derby Discussion <[email protected]>
Sent: Tuesday, 16 January, 2007 11:21:56 AM
Subject: Re: Result set as a return value of a Java stored procedure

Mirek Cervenka <[EMAIL PROTECTED]> writes:

> Hello,
>
> I have a following problem. I want to return a result set as a
> consequence of some processing by a Java stored procedure on Apache
> Derby DB, however, I am still getting a NULL resultset. Could anyone
> help me please? I would be very grateful!
>
> Here is the code. Registration of the stored procedure is as follows:
>
> CREATE PROCEDURE myTestProcedure() LANGUAGE JAVA PARAMETER STYLE
> JAVA CONTAINS SQL DYNAMIC RESULT SETS 1 EXTERNAL NAME
> 'StoredProcedures.myTestProcedure'
>
> The actual implementation of the stored procedure is:
>
>     public static void myTestProcedure(ResultSet[] rs) {
>         try {
>             Class.forName("org.apache.derby.jdbc.ClientDriver").newInstance();
>         } catch (Exception ex) {
>             ex.printStackTrace();
>         }
>         
>         try {
>             Connection c = null;
>             try {
>                 String dbUser = "blabla";
>                 String dbPassword = "blabla";
>                 c = 
> DriverManager.getConnection("jdbc:derby://localhost:1527/myTestDatabase", 
> dbUser, dbPassword);

Hi Mirek,

A stored procedure should use "jdbc:default:connection" as URL. The
rest of the code looks correct.

-- 
Knut Anders







                
___________________________________________________________ 
What kind of emailer are you? Find out today - get a free analysis of your 
email personality. Take the quiz at the Yahoo! Mail Championship. 
http://uk.rd.yahoo.com/evt=44106/*http://mail.yahoo.net/uk 

Reply via email to