Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

jdbc and ms access with stored query

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
------------------
 
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
brush
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.


 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, just re-register with a new name. Your old name will soon be disabled.
 
Do not meddle in the affairs of dragons - for you are crunchy and good with ketchup. Crunchy tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic