473,418 Members | 2,101 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

Question about connection java and Postgresql in Linux

DN
I am trying to use Redhat Linux 9, J2sdk 1.4.2 and Postgresql 7.3.2 to
do my setting. But, I cannot access the database to set/get data
through the java program. Please help give me some suggestions.
Here is what my setting and problems:
http://hk.geocities.com/daisy_nhy/java_postgresql2.html

Thanks
Nov 11 '05 #1
3 2951

On 20/09/2003 15:23 DN wrote:
I am trying to use Redhat Linux 9, J2sdk 1.4.2 and Postgresql 7.3.2 to
do my setting. But, I cannot access the database to set/get data
through the java program. Please help give me some suggestions.
Here is what my setting and problems:
http://hk.geocities.com/daisy_nhy/java_postgresql2.html

Thanks

The postgreSQL .jar file must go in common/lib _not_ share/lib. Two other
things:

1) have you enabled tcpip on the postmaster by seting

tcpip_socket = true

in /var/lib/pgsql/data/postgresql.conf

2) have you edited /var/lib/pgsql/data/pg_hba.conf to un-comment the line

# host all all 127.0.0.1 255.255.255.255 trust

because if you haven't done both of these, you won't be able to connect
from Java.

And before anybody jumps in, I'll just point out that the "host" line is
far too permissive to be used in production but if you're just starting
out experimenting with PostgreSQL and Java, it's one less thing to have to
worry about for now.

HTH

--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for the Smaller
Business |
| Computer Consultants |
http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+---------------------------------------------+
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 11 '05 #2
DN
Thank you for answering my question

I have moved postgresql.jar to common/lib.

Also, my setting are:
tcpip_socket = true
in /var/lib/pgsql/data/postgresql.conf

host all all 127.0.0.1 255.255.255.255 crypt
in /var/lib/pgsql/data/pg_hba.conf

but, it also cannot work well.
By the way, do I need to set
./configure with-java

if yes, how can I set it?
Nov 11 '05 #3

On 21/09/2003 09:30 DN wrote:
Thank you for answering my question

I have moved postgresql.jar to common/lib.

Also, my setting are:
tcpip_socket = true
in /var/lib/pgsql/data/postgresql.conf

host all all 127.0.0.1 255.255.255.255 crypt
in /var/lib/pgsql/data/pg_hba.conf

but, it also cannot work well.
By the way, do I need to set
./configure with-java

if yes, how can I set it?


../configure is used to build PostgreSQL from source. It doesn't affect any
of the run-time settings.

HTH

--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for the Smaller
Business |
| Computer Consultants |
http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+---------------------------------------------+

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 11 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in...
0
by: Johnson, Shaunn | last post by:
Howdy: Running PostgreSQL 7.2 and Oracle 9.2.0.1 on RedHat Linux 7.2. I'm trying to use the Ora2pg.pl script that I found on the PostgreSQL site. I'm hoping someone could point out what's...
0
by: ruhunu Gamarala | last post by:
Hi, I get the following exception periodically. does anybody what is the reason for it to throw this exception? I really appriciate if anyone can help me on this. thanks, Chinthaka at...
8
by: Együd Csaba | last post by:
Hi All, how can I improve the query performance in the following situation: I have a big (4.5+ million rows) table. One query takes approx. 9 sec to finish resulting ~10000 rows. But if I run...
2
by: Phil Campaigne | last post by:
Hi All, I am seting up my web app with a tomcat/postgresql hosting service. From my psql client I type psql and then I am asked for my password. This logs me into my hosted database just fine. ...
1
by: Janez Kostanj¹ek | last post by:
Hello everyone, this is my first post to postgres mailing list. System that I use: I am using Postgres under last CygWin published on public mirrors at the moment. OS system runing is...
4
by: ruben | last post by:
Hi: I'm getting this error when accessing a table with certain WHERE condition: "server closed the connection unexpectedly This probably means the server terminated abnormally before or while...
3
by: ggarrette | last post by:
Building OpenNMS 1.2.9 on OpenSUSE 10.3 using Postgres 8.2.7 When I run: $OPENNMS_HOME/bin/install -disU Output is: Exception in thread "main" org.postgresql.util.PSQLException: Connection...
1
by: gocraig | last post by:
PG Admin Version 1.6.0 (Nov 15 2006, rev 5641) Running on Windows 2000 PostgreSQL 8.2.6, running remotely on Linux pg_hba.conf contains the record ... host all all ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.