• Post Reply Bookmark Topic Watch Topic
  • New Topic

MS Access in JSP

 
L. Riley
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to simply read an MS Access database from a java server page. My code is very straight-forward and I am about 99% sure that it is correct.
HOWEVER, every time I pull the page up in a browser, Tomcat crashes.
Has anybody ever heard of anything like this? I am running Windows 2000 Server MS Access 2000.
I have been fiddling with this for a month. This is my first attempt at reading a database. I have been reading books, etc. and am getting nowhere.
Please help.
 
SoonAnn Lim
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have the correct driver setup? It is very likely the problem of classpath setting in the environmental variable. You may post the snippet of your code(that link to database) and the error messages.
 
L. Riley
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What would the correct driver be? Where would I get the correct driver?
Here is the code:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection ("jdbc dbc:employee");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("Select * from Employee");
while (rs.next())
{
String person = rs.getString("UserName");
}
con.close();
Nothing tricky to the code.
I get no error messages that I can find anywhere. Tomcat just dies.
Thank you for your time.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!