Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: CallableStatement Problem with Oracle database
It is hard to tell what the problem is if you dont submit the error
thrown by the catch block. Also what catch are you using. you may
want to catch both the NullPointerException for strings and the
SQLException for sql prepared statement errors. cheers.
muzza
In article <Gd2t4.1786$i_1.34869_at_dfiatx1-snr1.gtei.net>,
"Rookie" <Rookie.Programmer_at_gte.net> wrote:
> I execute the following:
>
> //
> try
> {
> System.out.println("Getting a connection.");
> Connection objConn =
> DbaseManager.getManager().getConnection();
>
> System.out.println("Preparing a statement.");
> CallableStatement objStmt =
> objConn.prepareCall(STR_CREATE_TV_PROP);
>
> System.out.println("Getting parameters.");
> objAllData.add(strUserID);
> System.out.println("Value =: " + strUserID;
>
> for(int i = 0 ; i < objGeneralData.size() ; i++)
> {
> String strValue1 = (String)objGeneralData.get(i);
> System.out.println("General Data Value " +
String.valueOf(i)
> + " = " + strValue1);
> objAllData.add(strValue1);
> }
>
> for(int j = 0 ; j < objTVData.size() ; j++)
> {
> String strValue2 = (String)objTVData.get(j);
> System.out.println("Radio Data Value " +
String.valueOf(j) +
> " = " + strValue2);
> objAllData.add(strValue2);
> }
>
> System.out.println("Setting parameters.");
> for(int x = 0 ; x < objAllData.size() ; x++)
> {
> String strValue = (String)objAllData.get(x);
> System.out.println("Setting parameter " + (x+1) + "
= " +
> strValue);
> objStmt.setString((x+1), strValue);
> }
> System.out.println("Getting ready to execute query!!!!");
> ResultSet objRes = objStmt.executeQuery();
> System.out.println("Executed Query!!!!");
> }
> //
>
> But I don't get the "Executed Query!!!!" print out. It stops
after "Getting
> ready to execute query!!!!". I verified that the Oracle Procedure
works in
> SQL Worksheet, and that the right number of parameters are given in
the
> "Setting parameter..." print out.
>
> Can anyone help or point me in the right direction? By the way,
there are
> 81 parameters given to this Procedure. I set the "?"'s in the static
String
> STR_CREATE_TV_PROP variable.
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Fri Feb 25 2000 - 15:46:22 CST
![]() |
![]() |