LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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


Reply
  Search this Thread
Old 04-01-2003, 02:54 PM   #1
Paulo Góes
Member
 
Registered: Feb 2003
Location: Rio de Janeiro - Brazil
Distribution: Slackware 11
Posts: 30

Rep: Reputation: 15
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
 
Old 04-01-2003, 03:03 PM   #2
mcleodnine
Senior Member
 
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731

Rep: Reputation: 45
Moved to the 'Programming' forum
.
 
Old 04-01-2003, 08:20 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Have you looked at the PostgreSQL
documentation, Chapter 5 of the
Programmer's Guide in particular?

Cheers,
Tink
 
Old 08-14-2003, 10:14 AM   #4
jdruin
Member
 
Registered: Jul 2003
Location: Louisville aka Derby City
Distribution: WinXP SP2 and SP3, W2K Server, Ubuntu
Posts: 313

Rep: Reputation: 30
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
 
Old 08-23-2003, 10:08 AM   #5
german
Member
 
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Debian etch, Gentoo
Posts: 312

Rep: Reputation: 30
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
create table in postgres database kranti Linux - Newbie 1 11-15-2005 06:52 PM
Problem with Postgres Database Connection anjani.78 Linux - Software 1 10-07-2005 02:06 AM
changing password for postgres database anjani.78 Linux - Software 1 07-18-2005 10:58 PM
php postgres connecting needed help vickr1z Linux - Newbie 2 11-11-2004 03:13 AM
Error connecting to postgres with pgAdmin koswo Linux - Software 1 02-10-2004 07:45 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration