Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 20th, 2004, 04:04 PM
NoodleBC NoodleBC is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 1 NoodleBC User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Error on stored procedure call from jsp

I'm trying to call a stored procedure from a jsp page using the code below,
but I am currently getting th efollowing error message:
"java.sql.SQLException: [BEA][Oracle JDBC Driver]The requested output parameter data is not available."
I am running weblogic 8.1 on my local machine and connecting to an Oracle 8i database.

Can someone tell me why I am getting this error? Thanks in advance for your help!

CallableStatement = conn.prepareCall("{ call ? := Func_Noodle_oqr_one(?,?)}");
st.registerOutParameter(1, OracleTypes.CURSOR);
st.setString(2,"");
st.setInt(3,neuId);
ResultSet rs = (ResultSet)st.getObject(1); // <- The error appears to be occuring at this point
rs = st.executeQuery();
while (rs.next()) {
System.out.println(rs.getString(1) + "\t" +
rs.getFloat(2) + "\t" +
rs.getDate(3).toString());
}

Reply With Quote
  #2  
Old October 24th, 2004, 05:24 AM
gertcuppens's Avatar
gertcuppens gertcuppens is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 118 gertcuppens User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 28 m
Reputation Power: 5
You're giving the ResultSet rs a value, twice.

ResultSet rs = (ResultSet)st.getObject(1); // <- The error appears to be occuring at this point
rs = st.executeQuery();

In my code, I write the following :

StringBuffer zoekString =
new StringBuffer();
zoekString.append ("select * from gebruiker ");
zoekString.append("where naam=? and wachtwoord=? ");
Connection con = getConnection();
PreparedStatement ps = con.prepareStatement(zoekString.toString());
ps.setString(1,_naam);
ps.setString(2,_wachtwoord);
ResultSet rs = ps.executeQuery();
if (rs.next() )
{
Gebruiker gebruiker = new Gebruiker(rs);
rs.close();
ps.close();
con.close();
return gebruiker;
}
In short, I use PreparedStatements and the ResultSet is given by the method
executeQuery() of the PreparedStatement.
I've read that PreparedStatements are said to be more performant than Statements.
Try this one


Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > Error on stored procedure call from jsp


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT