• Post Reply Bookmark Topic Watch Topic
  • New Topic

JDBC / RedHat 9/ PostgreSQL  RSS feed

 
Ravi Kanth D
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to access postgresql database (7.3.2 - default with RedHat 9 distro) using JDBC. I have a Linux user called "oracle" that I have created in postgresql server also and gave that user privileges to create a database.
I tried to create a databse using createdb and it works.
The url that I am using in JDBC is: "jdbc ostgresql://localhost:5432/test", "oracle", "". It reverts bck with error that says:
SQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
Can anyone plz help? Thanks.
Ravi.
 
Adrian Yan
Ranch Hand
Posts: 688
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure the port is open? I believe Redhat comes with a default firewall that blocks ports.
 
Abdul Basit
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
u have to open tcp connection .
go in postgresql.conf file of u r postgresql server .or search it in your system it will be in ../../Data/postgresql.cong .
open it and
edit this
#tcpip_socket = false
to this
tcpip_socket = true
then restart your postgresql server

this will work fine
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!