pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedstring de conexao em JAVA
2+ messages / 2 participants
[nested] [flat]
* string de conexao em JAVA
@ 2005-03-01 11:43 sandrigo.lezcano@gmail.com <sandrigo.lezcano@gmail.com>
0 siblings, 1 reply; 2+ messages in thread
From: sandrigo.lezcano@gmail.com @ 2005-03-01 11:43 UTC (permalink / raw)
To: pgsql-jdbc
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
===============================
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: string de conexao em JAVA
@ 2005-03-01 18:59 Nahum Castro <nahumcastro@gmail.com>
parent: sandrigo.lezcano@gmail.com <sandrigo.lezcano@gmail.com>
0 siblings, 0 replies; 2+ messages in thread
From: Nahum Castro @ 2005-03-01 18:59 UTC (permalink / raw)
To: sandrigo.lezcano@gmail.com <sandrigo.lezcano@gmail.com>; pgsql-jdbc
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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2005-03-01 18:59 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-03-01 11:43 string de conexao em JAVA sandrigo.lezcano@gmail.com <sandrigo.lezcano@gmail.com>
2005-03-01 18:59 ` Nahum Castro <nahumcastro@gmail.com>
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