This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 120006

Summary: Can't connect to PostgreSQL 7
Product: db Reporter: serge_gray <serge_gray>
Component: CodeAssignee: Jiri Rechtacek <jrechtacek>
Status: RESOLVED WORKSFORME    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:
Attachments: log during session

Description serge_gray 2007-10-25 11:20:32 UTC
Occurs when trying to connect to PosgreSQL database.
Following steps has made:
1. PosgreSQL server has installed on localhost and has successfully run
2. Database named "postgres" has created by mean server explorer - successfully
3. jdbc driver postgresql-8.2-506.jdbc4.jar has loaded in the database explorer - successfully
4. Trying to connect to database whith this options:
    URL=jdbc:postgresql:posgres
    user=valid name
    password=valid password
After clicking OK database explorer trying to connect. Waiting... for a long long time.
But connection is not established. There is no exeptions, no error messages. Just waiting for infinite tine.

This problem is not occures when connecting programmatically: DriverManager.getConnection()
Comment 1 Andrei Badea 2007-10-25 13:02:35 UTC
Try if turning the proxy off (Tools - Options) helps. If it doesn't, please do a full thread dump during the wait and
attach it to the issue. Thanks.
Comment 2 serge_gray 2007-10-26 06:23:40 UTC
I found that PosgreSQL jdbc driver type 3 (postgresql-8.2-506.jdbc3.jar) works correctly
But driver type 4 works incorrectly as I wrote.
How can I do a full thread dump during the wait connection?
Comment 3 Andrei Badea 2007-10-26 10:52:31 UTC
Simplest to start NetBeans from a terminal / console window and press Ctrl+\ during the wait. 

Also, please attach your messages.log file. It is located in var/log/messages log in your userdir (see
http://wiki.netbeans.org/wiki/view/FaqWhatIsUserdir).
Comment 4 serge_gray 2007-10-26 12:02:23 UTC
Created attachment 51771 [details]
log during session
Comment 5 Andrei Badea 2007-10-26 14:12:10 UTC
Seems the PostgreSQL JDBC 4 version is compiled with a 1.6 target level, but you run NetBeans on JDK 1.5. There is a
"bad version number in .class file" exception towards the end of the message log caused by this. So for JDK 1.5 you need
to use the JDBC 3 driver.

Still a valid bug for NetBeans, because it should display an error message instead of waiting indefinitely.
Comment 6 Jiri Rechtacek 2009-02-10 15:36:43 UTC
Reassigned to new owner.
Comment 7 Jiri Rechtacek 2009-09-17 11:12:58 UTC
I can connect ProgreSQL via postgresql-8.2-506.jdbc4 in recent NB IDE releases (NB6.7, NB6.8Beta)