pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedJDBC connection query..
2+ messages / 2 participants
[nested] [flat]
* JDBC connection query..
@ 2009-08-17 08:49 Monu Z <zmonu2008@gmail.com>
0 siblings, 1 reply; 2+ messages in thread
From: Monu Z @ 2009-08-17 08:49 UTC (permalink / raw)
To: pgsql-jdbc
Hi,
I am working with Jdeveloper 11, Java 1.6 and Postgresql 8.3 on Windows.
I got the jdbc driver postgresql-8.3-604.jdbc2,
postgresql-8.3-604.jdbc2ee, postgresql-8.3-604.jdbc3 and
postgresql-8.3-604.jdbc4.
Please help to me to establish database connection in Jdeveloper.
Please give me step-by-step complete details of how to establish
connection between Jdeverloper and postgresql8.3.
Thanks & Regards
Monu Zacharia
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: JDBC connection query..
@ 2009-08-17 16:31 dmp <danap@ttc-cmc.net>
parent: Monu Z <zmonu2008@gmail.com>
0 siblings, 0 replies; 2+ messages in thread
From: dmp @ 2009-08-17 16:31 UTC (permalink / raw)
To: pgsql-jdbc
> Hi,
>
> I am working with Jdeveloper 11, Java 1.6 and Postgresql 8.3 on Windows.
>
> I got the jdbc driver postgresql-8.3-604.jdbc2,
> postgresql-8.3-604.jdbc2ee, postgresql-8.3-604.jdbc3 and
> postgresql-8.3-604.jdbc4.
>
> Please help to me to establish database connection in Jdeveloper.
> Please give me step-by-step complete details of how to establish
> connection between Jdeverloper and postgresql8.3.
>
> Thanks & Regards
> Monu Zacharia
Hello,
The standard piece of Java code for establishing a connection
to a PostgreSQL database is listed below. Perhaps a posting to
a JDeveloper community or referencing its documentation might
be more helpful.
danap
try{
Class.forName("org.postgresql.Driver").newInstance();
}
catch (Exception e){
System.err.println("Unable to find and load driver" + e);
}
try{
Connection dbConnection;
String connectionProperties;
String host, port, db, user, passwordString;
host = "localhost";
port = "5432";
db = "mydatabase";
user = "danap";
passwordString = "mypassword";
connectionProperties = "jdbc:postgresql://" + host + ":" + port
+ "/" + db + "?user=" + user
+ "&password=" +
passwordString;
// System.out.println(connectionProperties);
dbConnection = DriverManager.getConnection(connectionProperties);
}
catch (SQLException e)
{
System.err.println(e);
}
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2009-08-17 16:31 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-08-17 08:49 JDBC connection query.. Monu Z <zmonu2008@gmail.com>
2009-08-17 16:31 ` dmp <danap@ttc-cmc.net>
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