Received: from casalinux.mkt.com (customer-MZT-221-17.megared.net.mx [200.52.221.17] (may be forged)) by postgresql.org (8.11.3/8.11.4) with ESMTP id f9G8i0P56480 for ; Tue, 16 Oct 2001 04:44:00 -0400 (EDT) (envelope-from meli@mzt.megared.net.mx) Received: from mzt.megared.net.mx (casalinux [172.16.1.4]) by casalinux.mkt.com (8.11.2/8.11.2) with ESMTP id f9G4DIf05324; Tue, 16 Oct 2001 00:13:18 -0400 Message-ID: <3BCBB3DD.1337B3CD@mzt.megared.net.mx> Date: Tue, 16 Oct 2001 00:13:18 -0400 From: Jesus Sandoval X-Mailer: Mozilla 4.76 [es] (X11; U; Linux 2.4.2-2 i686) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-admin@postgresql.org, Tom Lane Subject: [Fwd: What may be the url we need to use to connect the Postgres Database with Java] Content-Type: multipart/mixed; boundary="------------BB9CC8AA2F2A9E369AABDB6E" X-Archive-Number: 200110/139 X-Sequence-Number: 2384 Este es un mensaje multipartes en formato MIME. --------------BB9CC8AA2F2A9E369AABDB6E Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit --------------BB9CC8AA2F2A9E369AABDB6E Content-Type: message/rfc822 Content-Transfer-Encoding: 8bit Content-Disposition: inline X-Mozilla-Status2: 00000000 Message-ID: <3BCBB335.840393C6@mzt.megared.net.mx> Date: Tue, 16 Oct 2001 00:10:29 -0400 From: Jesus Sandoval X-Mailer: Mozilla 4.76 [es] (X11; U; Linux 2.4.2-2 i686) X-Accept-Language: en MIME-Version: 1.0 To: Moovarkku Mudhalvan Subject: Re: [ADMIN] What may be the url we need to use to connect the Postgres Database with Java References: <9pvop8$1h9p$1@news.tht.net> <1218.1002916236@sss.pgh.pa.us> <00c401c1554d$e17e7b50$ec01a8c0@eth.net> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Well let me send yo a little example program how to connect to postgresql from java: import java.sql.*; public class Cias { // Declara e inicializa variables protected int idCia; protected String nombre; public ResultSet rs; public Cias() throws ClassNotFoundException, SQLException { idCia = 0; nombre = new String(); Class.forName("org.postgresql.Driver"); Connection db = DriverManager.getConnection("jdbc:postgresql://localhost/prueba","jesus","jesus"); Statement st = db.createStatement(); rs = st.executeQuery("SELECT * from cias"); } public int getidCia() { return idCia; } public String getnombre() { return nombre; } public void leeuno() throws SQLException { rs.next(); idCia = rs.getInt(1); nombre = rs.getString(2); } public void leenext() throws SQLException { rs.next(); idCia = rs.getInt(1); nombre = rs.getString(2); } } I hope this help you. Jesus Sandoval from Mexico Moovarkku Mudhalvan escribió: > Hi friends, > Greetings. if we use the oracle as backend with Java programming we use > the url like > > jdbc.oracle.thin@ipaddress > like this do we have any url need to be used in Postgres if so let me know. > > The Driver i got it from the Package... > > Thanks > Mudhalvan M.M > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org --------------BB9CC8AA2F2A9E369AABDB6E--