473,480 Members | 1,688 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 2955

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
9198
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
3236
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
1642
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
3219
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
2163
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
4642
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
1733
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
27451
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
124885
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
7037
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
6904
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
7034
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6732
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6886
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
5324
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
2990
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2976
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1294
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.