gmollineau
asked on
How do I connect to MSSQL database using RPG?
Hi,
I am trying to connect to a MS SQL (2005) database from an AS400 running V5R2. I am using type 4 JDBC for MSSQL version 1.1 and JDK 1.4 is installed on the AS400. I found some code at the following url http://systeminetwork.com/article/access-ms-sql-server-database-rpg-program and I was trying to use it but I am getting the following error and need help "com.microsoft.sqlserver.j dbc.SQLSer verExcepti on: The TCP/IP connection to the host has failed. java.net.UnknownHostExcept ion:". I have checked the MS SQL configuration and it has the TCP/IP active. The server with the MS SQL is running Windows 2000 Server.
I have attached a compile listing of the program I am using.
Thanks.
SQLSERVER590557.txt
I am trying to connect to a MS SQL (2005) database from an AS400 running V5R2. I am using type 4 JDBC for MSSQL version 1.1 and JDK 1.4 is installed on the AS400. I found some code at the following url http://systeminetwork.com/article/access-ms-sql-server-database-rpg-program and I was trying to use it but I am getting the following error and need help "com.microsoft.sqlserver.j
I have attached a compile listing of the program I am using.
Thanks.
SQLSERVER590557.txt
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi,
I added the entry to the host table on the as400 and did the traceroute xlink_test.cansnack.com the following was recieved:
Message ID . . . . . . : TCP3261
Date sent . . . . . . : 10/10/08 Time sent . . . . . . : 08:01:30
Message . . . . : 1 XLINK_TEST.CANSNACK.COM (192.168.1.28) 0.640 0.590 0.56
Cause . . . . . : For hop 1, one or more responses were received from
XLINK_TEST.CANSNACK.COM (192.168.1.28). The response times in milliseconds
are:
0.640 0.590 0.561
Notes . . . . . :
- An asterisk (*) indicates a response packet was not received within the
specified time.
- The abbreviations below are appended to a response time to highlight
specific ICMP response messages.
/0 Network unreachable.
When I tried to run the program again I got the following message:
com.microsoft.sqlserver.jd bc.SQLServ erExceptio n: : Unrecoverable error
at java/lang/Throwable.<init> (Throwable .java:195)
at java/lang/Exception.<init> (Exception .java:41)
at java/sql/SQLException.<ini t>(SQLExce ption.java :40)
at com/microsoft/sqlserver/jd bc/SQLServ erExceptio n.<init>(U nknown Source)
at com/microsoft/sqlserver/jd bc/SQLServ erExceptio n.makeFrom DriverErro r(Unknown Source)
at com/microsoft/sqlserver/jd bc/SQLServ erConnecti on.sendLog on(Unknown Source)
at com/microsoft/sqlserver/jd bc/SQLServ erConnecti on.logon(U nknown Source)
at com/microsoft/sqlserver/jd bc/SQLServ erConnecti on.connect Helper(Unk nown Source)
at com/microsoft/sqlserver/jd bc/SQLServ erConnecti on.loginWi thoutFailo ver(Unknow n Source)
at com/microsoft/sqlserver/jd bc/SQLServ erConnecti on.connect (Unknown Source)
at com/microsoft/sqlserver/jd bc/SQLServ erDriver.c onnect(Unk nown Source)
I am running the program from a cl which looks like the following:
*************** Beginning of data ************************** *********
PGM
OVRPRTF FILE(STDOUT) TOFILE(QSYSPRT) HOLD(*YES) OVRSCOPE(*JOB)
OVRPRTF FILE(STDERR) TOFILE(QSYSPRT) HOLD(*YES) OVRSCOPE(*JOB)
/* ADDENVVAR ENVVAR(QIBM_RPG_JAVA_PROPE RTIES) +
VALUE('-Djava.version=1.4; +
Djava.awt.headless=true;+
Dos400.awt.native=true;') */
ADDENVVAR ENVVAR(QIBM_RPG_JAVA_PROPE RTIES) +
VALUE('-Djava.version=1.4; ')
/* ADDENVVAR ENVVAR(CLASSPATH) +
VALUE('/home/QIBM/UserData /Java400/e xt;/hom+
e/QIBM/ProdData/HTTP/Publi c/jt400/li b/jt400+
.jar;/home/QIBM/ProdData/J ava400/ext ') */
CALL SQLSERVER
ENDPGM
****************** End of data ************************** ********** ****
Any suggestions?
I added the entry to the host table on the as400 and did the traceroute xlink_test.cansnack.com the following was recieved:
Message ID . . . . . . : TCP3261
Date sent . . . . . . : 10/10/08 Time sent . . . . . . : 08:01:30
Message . . . . : 1 XLINK_TEST.CANSNACK.COM (192.168.1.28) 0.640 0.590 0.56
Cause . . . . . : For hop 1, one or more responses were received from
XLINK_TEST.CANSNACK.COM (192.168.1.28). The response times in milliseconds
are:
0.640 0.590 0.561
Notes . . . . . :
- An asterisk (*) indicates a response packet was not received within the
specified time.
- The abbreviations below are appended to a response time to highlight
specific ICMP response messages.
/0 Network unreachable.
When I tried to run the program again I got the following message:
com.microsoft.sqlserver.jd
at java/lang/Throwable.<init>
at java/lang/Exception.<init>
at java/sql/SQLException.<ini
at com/microsoft/sqlserver/jd
at com/microsoft/sqlserver/jd
at com/microsoft/sqlserver/jd
at com/microsoft/sqlserver/jd
at com/microsoft/sqlserver/jd
at com/microsoft/sqlserver/jd
at com/microsoft/sqlserver/jd
at com/microsoft/sqlserver/jd
I am running the program from a cl which looks like the following:
*************** Beginning of data **************************
PGM
OVRPRTF FILE(STDOUT) TOFILE(QSYSPRT) HOLD(*YES) OVRSCOPE(*JOB)
OVRPRTF FILE(STDERR) TOFILE(QSYSPRT) HOLD(*YES) OVRSCOPE(*JOB)
/* ADDENVVAR ENVVAR(QIBM_RPG_JAVA_PROPE
VALUE('-Djava.version=1.4;
Djava.awt.headless=true;+
Dos400.awt.native=true;') */
ADDENVVAR ENVVAR(QIBM_RPG_JAVA_PROPE
VALUE('-Djava.version=1.4;
/* ADDENVVAR ENVVAR(CLASSPATH) +
VALUE('/home/QIBM/UserData
e/QIBM/ProdData/HTTP/Publi
.jar;/home/QIBM/ProdData/J
CALL SQLSERVER
ENDPGM
****************** End of data **************************
Any suggestions?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
When I run the command I get the following:
Unknown host, XLINK_TEST.CANSNACK.COM.