Re: Stored Procedure Error ,No ResultSet was produced
From: Alin Sinpalean (alin_at_earthling.net)
Date: 04/21/04
- Next message: karendavis_at_optonline.net: "My new nipple and vagina piercings"
- Previous message: Joe Weinstein: "Re: GetBytes issue"
- In reply to: vikash verma: "Stored Procedure Error ,No ResultSet was produced"
- Messages sorted by: [ date ] [ thread ]
Date: 21 Apr 2004 00:35:03 -0700
vikash verma <reachvikash@yahoo.com> wrote in message news:<#M$EhdhJEHA.3380@TK2MSFTNGP09.phx.gbl>...
> Hi All
> I have written code in Java ie CLASS file.But my DBase is SQL.
> I call a Stored Procedure from my Java Class File.But i get this
> exception
>
> java.sql.SQLException: No ResultSet was produced
> at
> sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeQuery(JdbcOdbcPrepared
> Statement.java:97)
> at
> AutomaticTicketCursor.CursorATG(AutomaticTicketCursor.java:254)
> at AutomaticTicketCursor.main(AutomaticTicketCursor.java:270)
> Main Fn()
The exception is as clear as possible. Your stored procedure doesn't
produce any ResultSet (i.e. if you execute it in Query Analyzer you'll
see that it only produces update counts because there is no SELECT
statement).
executeQuery() is only intended to be used with queries that generate
ResultSets. For queries that generate update counts and for DDL
statements use executeUpdate(). If you don't know what you'll be
executing use execute(). Read the JDBC API documentation for more
information.
And BTW, don't use the JDBC-ODBC bridge in production environments.
Alin.
- Next message: karendavis_at_optonline.net: "My new nipple and vagina piercings"
- Previous message: Joe Weinstein: "Re: GetBytes issue"
- In reply to: vikash verma: "Stored Procedure Error ,No ResultSet was produced"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|