Hi there..
I am a beginner with jsp and am having a problem connecting to a access database.
Every time I try to view the jsp in a browser I get the following error..
[2001/09/18 14:22:44] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
 at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6031)
 at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6188)
 at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:2458)
 at sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:320)
 at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:163)
 at java.sql.DriverManager.getConnection(DriverManager.java:517)
 at java.sql.DriverManager.getConnection(DriverManager.java:177)
 at _jsp._test._test4._test__jsp._jspService(_test__jsp.java:45)
 at com.caucho.jsp.JavaPage.service(JavaPage.java:89)
 at com.caucho.jsp.JavaPage.subservice(JavaPage.java:83)
 at com.caucho.jsp.Page.service(Page.java:280)
 at com.caucho.jsp.QServlet.service(QServlet.java:161)
 at com.caucho.server.http.AbstractRequest.service(AbstractRequest.java:454)
 at com.caucho.server.http.AbstractRequest.service(AbstractRequest.java:397)
 at com.caucho.server.http.PageCache$Entry.service(PageCache.java:256)
 at com.caucho.server.http.PageCache.service(PageCache.java:105)
 at com.caucho.server.http.VirtualHost.service(VirtualHost.java:424)
 at com.caucho.server.http.Request.dispatch(Request.java:213)
 at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:313)
 at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:260)
 at com.caucho.server.TcpConnection.run(TcpConnection.java:142)
 at java.lang.Thread.run(Thread.java:484)
 
I dont under stand this cause I have made a data source called called TESTJSP for my access database
Here is the code for my jsp..
<%@page import="java.sql.*"%>
<% Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");%>
 <% String data="jdbc:odbc:TESTJSP";
 Connection connection=DriverManager.getConnection(data," "," ");
  Statement statement =connection.createStatement();
  ResultSet results=statement.executeQuery("Select * from Names");
%>
<html>
<body>
<P> The results are:
   </P>
   <UL>
   <% while (results.next()) { %>
     <LI><%= results.getString(1)%></LI>
   <% } %>>
   </UL>
</html>
</body>
 
 
If you could please help,I would be sooo grateful

Reply via email to