Received: from wiprom2mx1.wipro.com (wiprom2mx1.wipro.com [203.197.164.41]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eBC65xm30484 for ; Tue, 12 Dec 2000 01:05:59 -0500 (EST) (envelope-from vijayendra.agrawal@wipro.com) Received: from m2vwall2.wipro.com (m2vwall2.wipro.com [164.164.27.52]) by wiprom2mx1.wipro.com (8.9.3+Sun/8.9.3) with SMTP id LAA12947 for ; Tue, 12 Dec 2000 11:43:19 GMT Received: from Protea.wipro.com ([192.168.20.42]) by sarovar.mail.wipro.com (Netscape Messaging Server 3.6) with ESMTP id AAA4CDF for ; Tue, 12 Dec 2000 11:34:09 +0530 Reply-To: From: "vijayendra mohan agrawal" To: "PostGre SQL Mailing List" Subject: JDBC Driver Date: Tue, 12 Dec 2000 11:39:09 +0530 Message-ID: <001f01c06402$0a8e8b40$2a14a8c0@Protea.wipro.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3612.1700 Importance: Normal X-Archive-Number: 200012/63 X-Sequence-Number: 255 Hi all, I want to use PostGreSQL in my Java application. I have compiled jdbc2 since I am using JDK1.2 I have placed the jar file in my CLASSPATH. I am trying to connect to PostGreSQL server running in HP-UX machine connected to my PC through LAN. In my machine, I am working in Windows 95 platform. The following piece of code depicts, how I am trying to connect to the server. But it returns false for acceptsURL() call itself and throws SQLException. In the HP-UX machine, where I am running PostGreSQL server, I didn't see port 5432 in /etc/services. Shall I add one entry with this port number here. What else might be required ? try { Class.forName("org.postgresql.Driver"); org.postgresql.Driver dr = new org.postgresql.Driver(); System.out.println("driver accepts URL :" + dr.acceptsURL("jdbc:org.postgresql://192.168.20.19:5432/avijaynesimdb")); System.out.println("Connecting to "+url); con = DriverManager.getConnection(url,usr,pwd); System.out.println("Connected "+con); st = con.createStatement(); } catch(ClassNotFoundException cnfe) { System.out.println("Could not find JDBC driver. Please check the CLASSPATH. " + cnfe.getMessage()); } catch(SQLException sqle) { System.out.println("Could not connect to database. " + "Please check whether the database server is running or not. " + sqle.getMessage()); } Thank You, Best Regards, Vijay ************************************************************ Vijayendra Mohan Agrawal Wipro Technologies 26, Hosur Main Road, Bommanhalli, Bangalore-560068, India Tel: 91-80-5722296 Extn:3076 Fax: 91-80-5722696 E-mail : Vijayendra.Agrawal@wipro.com **************************************************************