important question - Mailing list pgsql-bugs

From najeeb ahmed
Subject important question
Date
Msg-id 20001206113526.48715.qmail@web10503.mail.yahoo.com
Whole thread Raw
List pgsql-bugs
Dear sir,
   we are finding it difficult to connect to
postgresql database using the postgresql driver i.e.
using jdbc connectivity..trying it on apache web
server on linux
otherwise in ordinary applications it is working fine.
    Could u plz suggest us a remedy as soon as possible..
thanking you sir,
najeeb

the pgm is here..
import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class tester extends HttpServlet
    {
        public void doGet(HttpServletRequest
req,HttpServletResponse res) throws
ServletException,IOException
        {

                res.setContentType("text/html");
                PrintWriter pw=res.getWriter();

            try
            {
        Driver
d=(Driver)Class.forName("postgresql.Driver").newInstance();
        DriverManager.registerDriver(d);

        java.sql.Connection
con=DriverManager.getConnection("jdbc:postgresql:najeeb","najeeb","");
                Statement st=con.createStatement();
                ResultSet rs=st.executeQuery("select hi from
test");

                while(rs.next())
                {    String str=rs.getString(1);pw.println(str); }
        pw.close();rs.close();st.close();con.close();
            }
            catch(Exception ex)
            {
                         pw.println(ex);
            }

        }
    }


__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/

pgsql-bugs by date:

Previous
From: Vasko Miroslav
Date:
Subject: obsolete version of python bindings
Next
From: Mark Stosberg
Date:
Subject: select cash_out('2'); crashes backend on 7.0.2