Connecting Tech Pros Worldwide Help | Site Map

accessing an Access-query from an applet

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 06:10 PM
wnstnsmith@yahoo.com
Guest
 
Posts: n/a
Default accessing an Access-query from an applet

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

  #2  
Old November 12th, 2005, 06:10 PM
Tom van Stiphout
Guest
 
Posts: n/a
Default 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]

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.