Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
04-01-2003, 02:54 PM
|
#1
|
Member
Registered: Feb 2003
Location: Rio de Janeiro - Brazil
Distribution: Slackware 11
Posts: 30
Rep:
|
Connecting a Postgres Database from a Java application
How can I connect a Postgres Database from a Java application? Someone could help me describing a step-by-step set of instructions about how to do it? In my machine is installed Postgres 7.2.3 and JSDK 1.4.1
Thanks
|
|
|
04-01-2003, 03:03 PM
|
#2
|
Senior Member
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731
Rep:
|
Moved to the 'Programming' forum
.
|
|
|
04-01-2003, 08:20 PM
|
#3
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
Have you looked at the PostgreSQL
documentation, Chapter 5 of the
Programmer's Guide in particular?
Cheers,
Tink
|
|
|
08-14-2003, 10:14 AM
|
#4
|
Member
Registered: Jul 2003
Location: Louisville aka Derby City
Distribution: WinXP SP2 and SP3, W2K Server, Ubuntu
Posts: 313
Rep:
|
Hello.
1. set up the postgresql.conf file to allow tcpip connections
2. set up the pg_hba.conf file to allow your network to connect
3. restart postgres with the "-i" option to allow intranet connection
4. follow instrctions the java obdc chapter at http://www.postgresql.org/docs/7.3/i...tive/jdbc.html
|
|
|
08-23-2003, 10:08 AM
|
#5
|
Member
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Debian etch, Gentoo
Posts: 312
Rep:
|
I would highly recommend NOT using ODBC in java, ever, ever, ever. It destroys the platform neutrality of JDBC, and this is, after all, a Linux forum. Just put the postgres JDBC driver on the classpath, and use standard JDBC calls.
http://java.sun.com/docs/books/tutorial/jdbc/basics/
that should help you along.
HTH
B.
|
|
|
All times are GMT -5. The time now is 10:38 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|