This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes problem with retrieving data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
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
Similar Threads
Instatiating java class inside a servlet
two dropdown menus
Error 500 when trying to run servlet connecting to mysql
program to make start-connect by (oracle )
Geting an SQL Exception while passing the resultset to a bean