If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > JDBC :I got some problem to connect to database ...

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-27-03, 03:40
albert.chang albert.chang is offline
Registered User
 
Join Date: Feb 2003
Posts: 3
Red face JDBC :I got some problem to connect to database ...

Hi
I got some problem to connect to database ...

Here is the situation:
Informix build on AIX (IP:10.1.2.20 PORT:20006)

(1)
When URL=
jdbc:informix-sqli://10.1.2.20:20006/x509Cert_db:INFORMIXSERVER=f40_server

I run my java application on Window2000 platform (IP:10.1.2.139)
it can connect to database correctly , but when run the same java application on AIX(IP:10.1.2.20) it can't connect to database ...
I got error:
Unable to load locale categories.
(Error code :-23101)

(2)
When URL=
jdbc:informix-sqli://localhost:20006/x509Cert_db:INFORMIXSERVER=f40_server

I run my java application on AIX(IP:10.1.2.20) it still can't connect to database.
I got error:
Attempt to connect to database server (f40_server) failed.
(Error code :-908)

What's wrong?
Reply With Quote
  #2 (permalink)  
Old 02-28-03, 03:32
eherber eherber is offline
Registered User
 
Join Date: Aug 2002
Location: Bonn/Germany
Posts: 152
Re: JDBC :I got some problem to connect to database ...

Number (2) can't work because the IFMX databaseserver
is listening on the 10.1.2.20 IP address and not on the
localhost IP address.
If you want to be able to connect using 'localhost' you have
to setup a new DBSERVERALIASES and configure this
in your $INFORMIXSQLHOSTS file to start a listener on
'localhost'.

Are you able to connect via 'dbaccess' from the second
AIX host ?

Error -23101 is normally issued when your $INFORMIXDIR
settings are not appropriate.
However with JDBC you don't need to set INFORMIXDIR
because all you need is the JDBC-Driver (ifxjdbc.jar) on
your client machine in order to connect to the IFMX databaseserver.

I'm not sure, but I would suggest that you check your
environment settings on the AIX box.



Quote:
Originally posted by albert.chang
Hi
I got some problem to connect to database ...

Here is the situation:
Informix build on AIX (IP:10.1.2.20 PORT:20006)

(1)
When URL=
jdbc:informix-sqli://10.1.2.20:20006/x509Cert_db:INFORMIXSERVER=f40_server

I run my java application on Window2000 platform (IP:10.1.2.139)
it can connect to database correctly , but when run the same java application on AIX(IP:10.1.2.20) it can't connect to database ...
I got error:
Unable to load locale categories.
(Error code :-23101)

(2)
When URL=
jdbc:informix-sqli://localhost:20006/x509Cert_db:INFORMIXSERVER=f40_server

I run my java application on AIX(IP:10.1.2.20) it still can't connect to database.
I got error:
Attempt to connect to database server (f40_server) failed.
(Error code :-908)

What's wrong?
__________________

Best regards

Eric
--
IT-Consulting Herber
WWW: http://www.herber-consulting.de
Email: eric@herber-consulting.de

***********************************************
Download the IFMX Database-Monitor for free at:
http://www.herber-consulting.de/BusyBee
***********************************************
Reply With Quote
  #3 (permalink)  
Old 02-28-03, 14:44
albert.chang albert.chang is offline
Registered User
 
Join Date: Feb 2003
Posts: 3
Smile Re: JDBC :I got some problem to connect to database ...

Thanks for your help!
(And sorry, my english was poor! )

ENVIRONMENT VARIABLES on AIX :
INFORMIXDIR=/home/informix
CLIENT_LOCALE=TW.Big5
DB_LOCALE=TW.Big5

With the same database, java application and JDBC-Driver.
In situation (1), both my java application were a client program for the database, but I got different results. It seems not wrong with informix.

Do you think the different in JRE will cause these results? (On window2000 is JDK 1.3.1 ,Sun version. On AIX is JDK 1.3.0 ,IBM version)



Quote:
Originally posted by eherber
Number (2) can't work because the IFMX databaseserver
is listening on the 10.1.2.20 IP address and not on the
localhost IP address.
If you want to be able to connect using 'localhost' you have
to setup a new DBSERVERALIASES and configure this
in your $INFORMIXSQLHOSTS file to start a listener on
'localhost'.

Are you able to connect via 'dbaccess' from the second
AIX host ?

Error -23101 is normally issued when your $INFORMIXDIR
settings are not appropriate.
However with JDBC you don't need to set INFORMIXDIR
because all you need is the JDBC-Driver (ifxjdbc.jar) on
your client machine in order to connect to the IFMX databaseserver.

I'm not sure, but I would suggest that you check your
environment settings on the AIX box.
Reply With Quote
  #4 (permalink)  
Old 03-01-03, 04:55
eherber eherber is offline
Registered User
 
Join Date: Aug 2002
Location: Bonn/Germany
Posts: 152
I don't think that this a problem of the JVM.

Is there a difference in the JDBC versions you use
on Windows and AIX ?

You can get the version information of the IFMX JDBC driver
with the following command:

java com.informix.jdbc.Version


Older versions of the IFMX JDBC driver didn't support
NLS databases. So this might be the problem.
Try unsetting CLIENT_LOCALE and DB_LOCALE and
test the connection again.
__________________

Best regards

Eric
--
IT-Consulting Herber
WWW: http://www.herber-consulting.de
Email: eric@herber-consulting.de

***********************************************
Download the IFMX Database-Monitor for free at:
http://www.herber-consulting.de/BusyBee
***********************************************
Reply With Quote
  #5 (permalink)  
Old 03-03-03, 05:28
albert.chang albert.chang is offline
Registered User
 
Join Date: Feb 2003
Posts: 3
I use the same IFMX JDBC driver on Windows and AIX.
This is the version information :

IBM Informix JDBC Driver Version 2.21.JC2
Software Serial Number (Unregistered Version)


When unsetting CLIENT_LOCALE and DB_LOCALE and
test the connection again, I got the same result :

java.sql.SQLException: Unable to load locale categories.
at com.informix.util.IfxErrMsg.getSQLException(IfxErr Msg.java:348)
at com.informix.jdbc.IfxSqli.addException(IfxSqli.jav a:3025)
at com.informix.jdbc.IfxSqli.receiveError(IfxSqli.jav a:3335)
at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java :2288)
at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.j ava(Compiled Code))
at com.informix.jdbc.IfxSqli.executeOpenDatabase(IfxS qli.java:1703)
at com.informix.jdbc.IfxSqliConnect.<init>(IfxSqliCon nect.java:1007)
at java.lang.reflect.Constructor.newInstance(Native Method)
at com.informix.jdbc.IfxDriver.connect(IfxDriver.java :251)
at java.sql.DriverManager.getConnection(DriverManager .java:523)
at java.sql.DriverManager.getConnection(DriverManager .java:183)
at TESTDB.main(TESTDB.java:12)



I think some environment settings on the AIX were not correct. I'll try again.


Quote:
Originally posted by eherber
I don't think that this a problem of the JVM.

Is there a difference in the JDBC versions you use
on Windows and AIX ?

You can get the version information of the IFMX JDBC driver
with the following command:

java com.informix.jdbc.Version


Older versions of the IFMX JDBC driver didn't support
NLS databases. So this might be the problem.
Try unsetting CLIENT_LOCALE and DB_LOCALE and
test the connection again.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On