Connecting Tech Pros Worldwide Forums | Help | Site Map

accessing an Access-query from an applet

wnstnsmith@yahoo.com
Guest
 
Posts: n/a
#1: Nov 12 '05
Dear all,

Maybe I'm stupid, in any case I'm stupefied by now. Please help.

Stored procedures in Access should be accessible from a java-applet throught
a callable statement, but all I get is error messages from Access, which
tell me nothing.

Can anybody tell me what is wrong with the following:

In an Access database, I have a selectionquery called TEST, which simply
yields a set of string values:

This is the query in the database:
SELECT name FROM dogs

The output should be someting like:
Spot
George
Fido
....

Now this is the Java-call:
String query = "{ ? = call test }";
CallableStatement cal = theExistingConnection.prepareCall(query);
cal.executeQuery();
ResultSet r = cal.getResultSet();

The execute-statement fails, returning SQLException 70002: field COUNT is
incorrect. Why?

And while we're at it, is there a CLEAR example anywhere on the net of
stored-procedure calls and what parameters to set and why?

Thanks in advance,

WS

Tom van Stiphout
Guest
 
Posts: n/a
#2: Nov 12 '05

re: accessing an Access-query from an applet


On Fri, 16 Jan 2004 12:57:07 GMT, wnstnsmith@yahoo.com wrote:

I'm on thin ice with Java, but the SELECT query has a problem in that
it uses a reserved word. Try modifying your table and then use:
SELECT DogName from Dogs
Or if you must:
SELECT [name] FROM dogs

Also make sure executeQuery is indeed the right method to run a SELECT
query, and that it is not just used for ACTION queries (i.e. UPDATE,
APPEND etc).

What happened to Fluffy?

-Tom.

[color=blue]
>Dear all,
>
>Maybe I'm stupid, in any case I'm stupefied by now. Please help.
>
>Stored procedures in Access should be accessible from a java-applet throught
>a callable statement, but all I get is error messages from Access, which
>tell me nothing.
>
>Can anybody tell me what is wrong with the following:
>
>In an Access database, I have a selectionquery called TEST, which simply
>yields a set of string values:
>
>This is the query in the database:
>SELECT name FROM dogs
>
>The output should be someting like:
>Spot
>George
>Fido
>...
>
>Now this is the Java-call:
>String query = "{ ? = call test }";
>CallableStatement cal = theExistingConnection.prepareCall(query);
>cal.executeQuery();
>ResultSet r = cal.getResultSet();
>
>The execute-statement fails, returning SQLException 70002: field COUNT is
>incorrect. Why?
>
>And while we're at it, is there a CLEAR example anywhere on the net of
>stored-procedure calls and what parameters to set and why?
>
>Thanks in advance,
>
>WS[/color]

Closed Thread