Skip site navigation (1) Skip section navigation (2)

important question

From: najeeb ahmed <najeeb_a_99(at)yahoo(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: important question
Date: 2000-12-06 11:35:26
Message-ID: 20001206113526.48715.qmail@web10503.mail.yahoo.com (view raw or flat)
Thread:
Lists: 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

Next:From: Mark StosbergDate: 2000-12-06 20:06:07
Subject: select cash_out('2'); crashes backend on 7.0.2
Previous:From: najeeb ahmedDate: 2000-12-06 04:55:26
Subject: source code of jdbc drivers

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group