This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes jdbc and ms access with stored query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "jdbc and ms access with stored query" Watch "jdbc and ms access with stored query" New topic
Author

jdbc and ms access with stored query

brush
Greenhorn

Joined: Mar 14, 2001
Posts: 2
I am having trouble executine a stored query in microsoft access. Is the syntax the same for stored queries in ms access the same as sql server. Here is the code the I am trying
public DBResultSet executeStoredProcedure(String theCall ){
String[] a;
Statement st;
Connection c;
ResultSet rs;
CallableStatement cs;
DBResultSet aResultSet;
try{
System.out.println("Stored Procedure is \n" + theCall + "\n");
if (this.isConnected() == false )
return null;
c = this.getConnection();
if ( c != null ){
cs = c.prepareCall(theCall);
rs = cs.executeQuery();
System.out.println("Prepared Statement" + theCall + "\n");
}else{
System.out.println("Can not execute query. No connection");
return null;
}
aResultSet = new DBResultSet( rs );
cs.close();
this.connection.close();
return aResultSet;
}catch(SQLException sql ){
System.out.println("SQL Exception in executeQuery");
sql.printStackTrace();
return null;
}
}
Any help with the syntax of stored queries and ms access is appreciated
------------------
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, which you agreed to when you registered, described at http://www.javaranch.com/name.jsp .
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. A single charaacter for a last name is not acceptable. Please choose a new name which meets the requirements.
Thanks.

------------------
Moderator of the JDBC Forum


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
brush
Greenhorn

Joined: Mar 14, 2001
Posts: 2
O.K Where do I change my username? Do I have to re register?
Thanks for the help
Brian
Originally posted by Thomas Paul:
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, which you agreed to when you registered, described at http://www.javaranch.com/name.jsp .
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. A single charaacter for a last name is not acceptable. Please choose a new name which meets the requirements.
Thanks.


Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
yes, just re-register with a new name. Your old name will soon be disabled.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jdbc and ms access with stored query
 
Similar Threads
An unexpected error of Java Runtime Environment:
Java application Microsoft SQL server
Slight JTable problem
Reuse an object?
AbstractTableModel NullPointerException