• 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

JDBC connection to MS Access

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sir i want to connect jsp with MS-Access
the code is--------

<!-- jai shri ram -->
<html>
<head><title>JAI SHRI RAM</title></head>

<body>
<%@ page import="java.sql.*" %>
<%
String user1 = null;
String pass1 = null;
ResultSet rs = null;
Statement st = null;
Connection conn = null;
try
{

String url = "jdbc dbc:lala" ;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn = DriverManager.getConnection(url,"","");
st = conn.createStatement();
rs = st.executeQuery("select * from ram1");
while(rs.next() )
{
System.err.println( rs.getString("name") );
System.out.println(rs.getString("password"));

user1 = rs.getString("name");
pass1 = rs.getString("name");
out.println(user1+" "+pass1);
}
}
catch(Exception e)
{
out.println("there is an error");
}
out.println("jai shri ram");
%>
</body></html>

but it is giving an error as it is going into catch block.......
please help me out..it is veru necessary
thankyou
gurav
 
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Gaurav
The catch statements you used doesnt help you conclude anything what the error is about. provide some meaning ful catch statements and if possible print the stack to find what the actual error is.
As of the connection to access,
did u created the DSN named 'lala' in the ODBC32 of windows? if not ,do check it and create either a System or File dsn named 'lala' and then test the application.

Raj
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic