pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nahum Castro <nahumcastro@gmail.com>
To: sandrigo.lezcano@gmail.com <sandrigo.lezcano@gmail.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: string de conexao em JAVA
Date: Tue, 1 Mar 2005 12:59:11 -0600
Message-ID: <714bb51a05030110592ffb47e3@mail.gmail.com> (raw)
In-Reply-To: <1a5d58e6050301034377b5c5f6@mail.gmail.com>
References: <1a5d58e605030103365c83995d@mail.gmail.com>
	<1a5d58e6050301034377b5c5f6@mail.gmail.com>

Hola pedes hacer la conexión como sigue.
primero das de alta el driver
Class.forName("org.postgresql.Driver");
para conectarte usas
    
String url = "jdbc:postgresql://localhost/test";
Properties props = new Properties();
props.setProperty("user","fred");
props.setProperty("password","secret");
props.setProperty("ssl","true");
Connection conn = DriverManager.getConnection(url, props);

String url = "jdbc:postgresql://localhost/test?user=fred&password=secret&ssl=true";
Connection conn = DriverManager.getConnection(url);

Saludos y espero que me entiendas por que no se portuges.



On Tue, 1 Mar 2005 08:43:05 -0300, sandrigo.lezcano@gmail.com
<sandrigo.lezcano@gmail.com> wrote:
> No Visual FoxPro pode-se usar uma string de conexao tipo:
> SEM usar DSN.
> 
> pgsqlStringConnec = ;
>  'DRIVER={PostgreSQL};DATABASE=template1;SERVER=localhost;'+;
>  'PORT=5432;UID=postgres;PWD=dbtest;'+;
>  'a06=;a07=100;a08=4069;b0=254;b1=8190;bi=0;c2=dd_;;cx=1a403ab'
> 
> STORE SQLSTRINGCONNECT(pgsqlStringConnec ) TO gnHandle_pgsql
> IF gnHandle_pgsql < 0
>    = MESSAGEBOX('Erro!!', 16, 'Erro de  SPT/ODBC ao PostgreSQL')
> ENDIF
> 
> como poso fazelo no JAVA para nao usar um DSN-ODBC
> GRATO.
> --
> ___________________________________
> sandrigo.lezcano@gmail.com
> RUA INDEPENDENCIA 135 - BOA VISTA
> CEP 06411-050 - Barueri/SP/Brazil
> FONE 11  4198-1095
> Vip-Systems Informatica
> http://www.vip-systems.com.br
> ===============================
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
> 


-- 
Nahum Castro González
León, Guanajuato, México



view thread (2+ messages)

Message-ID: <714bb51a05030110592ffb47e3@mail.gmail.com>
Permalink:  ../714bb51a05030110592ffb47e3@mail.gmail.com/
Also on:    postgresql.org/message-id/714bb51a05030110592ffb47e3@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: nahumcastro@gmail.com, sandrigo.lezcano@gmail.com
  Subject: Re: string de conexao em JAVA
  In-Reply-To: <714bb51a05030110592ffb47e3@mail.gmail.com>
  References: <1a5d58e605030103365c83995d@mail.gmail.com> <1a5d58e6050301034377b5c5f6@mail.gmail.com> <714bb51a05030110592ffb47e3@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox