• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

a easy question please help !!!

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how can I access microsoft access2000 in jsp
this is my code
<%@ page contentType="text/html; charset=gb2312"%>
<%@ page import="java.sql.*"%>
<%
java.sql.Connection sqlConn;
java.sql.Statement sqlStmt;
java.sql.ResultSet sqlRst;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
sqlConn=java.sql.DriverManager.getConnection("jdbc.odbc.people");
sqlStmt=sqlConn.createStatement(java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE,java.sql.ResultSet.CONCUR_READ_ONLY);
sqlRst=sqlStmt.executeQuery("select name,age from people");
%>
<html>
<head>
<title>JDBC ACCESS 测试<title>
</head>
<body>
<table border="1" cellspacing="0" align="center">
<tr>
<th>姓名<th>
<th>年龄</th>
</tr>
<%while(sqlRst.next()){%>
<tr>
<td><%=sqlRst.getString(1)%></td>
<td><%=sqlRst.getLong(2)%></td>
</tr>
<%}%>
</table>
</body>
</html>
<%
sqlRst.close();
sqlStmt.close();
sqlConn.close();
%>

but tomcat says "no suitable driver"
 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
David,
I'm sure you figured out an answer to your question and I'm not even certain this will help you out since it's Java and not JSP, but figured I would share some beginner code I have been creating for a training plan which might give you some pointers? The following code does successfully attach to an Access 2000 DB from within JDK 1.4.1 using a User DSN:

Remember, it's meant as a training tool! Hope this helps!
Janet
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic