Bookmark Topic Watch Topic
  • New Topic

Error while connecting to database  RSS feed

gaurav chhabra
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Report post to moderator
sir i want to connect jsp with MS-Access
the code is--------

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

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

String url = "jdbc dbc:lala" ;
conn = DriverManager.getConnection(url,"","");
st = conn.createStatement();
rs = st.executeQuery("select * from ram1");
while( )
System.err.println( rs.getString("name") );

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");

but it is giving an error as it is going into catch block.......
please help me is veru necessary
Adeel Ansari
Ranch Hand
Posts: 2874
Bear Bibeault
Author and ninkuma
Posts: 66152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not cross-post the same question in multiple forums.
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!