Re: java connection to IDS
Posted in 1999
James
Your jdbc url seems to be pointing to interface1 which points to the
service on_server, while you are looking at port 1521 which has the service
thingo, which corresponds to the INFORMIXSERVER=interface2. Thus your URL
needs to read:
Connection connection = DriverManager.getConnection("
"jdbc:informix-sqli://mycomputer:1521/databasename:informixserver=interface
2;use
r=me;password=mine");
HTH
Sujit
james <jamesb@nelsonbay.com> on 07/28/99 07:29:16 AM
To: informix-list@iiug.org
cc: (bcc: Sujit Pal)
Subject: java connection to IDS
Hi,
Yet another question on how to connect java to IDS.
/etc/services conatins a line :-
thingo 1521/tcp
/usr/informix/etc/sqlhosts conatins a couple of lines :-
interface1 onipcshm mycomputer on_server
interface2 onsoctcp mycomputer thingo
CLASSPATH = /usr/java/lib/classes.zip:
/usr/informix/lib/java/lib/driver/lib/ifxjdbc.jar:.
INFORMIXDIR = /usr/informix
INFORMIXDIR = interface1
INFORMIXSQLHOSTS = /usr/informix/etc/sqlhosts
The java program says :-
Class.forName("com.informix.jdbc.IfxDriver");
This runs OK.
Then the connection bit says :-
Connection connection = DriverManager.getConnection("
"jdbc:informix-sqli://mycomputer:1521/databasename:informixserver=interface
1;use
r=me;password=mine");
This results in an SQLException :-
Attempt to connect to database server ( Java socket exception encounted:
connection refused ) failed.
The IDS ( Solaris 2.6 with the java 1.6 running on the same box ) is
on-line OK, but what gets it listening on 1521 as nothing shows in netstat
-a ? The interface2 produces the same result.
thanks,
james ( jamesb at nelsonbay dot com ).