java connection to IDS
Posted in 1999
Topics: Connectivity: ODBC / JDBC / .NET, Security, Permissions & Auditing, Networking & sqlhosts Configuration, Platform-Specific Issues, Java & JDBC Development
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=interface1;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 ).
Are you behind a firewall?
james <jamesb@nelsonbay.com> wrote in message
news:7nn51e$p9d$1@news.xmission.com...
>
> 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=interface1
;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 ).