File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes problem with retrieving data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "problem with retrieving data" Watch "problem with retrieving data" New topic

problem with retrieving data

Waqas Ahmed Siddiqui

Joined: Feb 08, 2003
Posts: 4
i have succesfully set the database but the proble im having is that i am unable to retrieve information from my database.
The coding is as follow:
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
public class test extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
PrintWriter out=res.getWriter();
String u1="SELECT user,pass FROM id1";
db db1=new db();
Connection con1=db1.getConnection();
try {
Statement st=con1.createStatement();
ResultSet rs1=st.executeQuery(u1);
catch(Exception e)
Note : here db is my methods class which is not shown here.

Can u Help Me???
Peter den Haan
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
If you would post a stack trace that'd give us more of a handle on the problem... use e.printStackTrace(out).
- Peter
I agree. Here's the link:
subject: problem with retrieving data
It's not a secret anymore!