Thanks. I thought I was missing some pakcages or some logic to establish the 
connection and access the db. I will reach my system admin. Thanks again :-)

"Clapham, Paul" <pclapham@xxxxxxxxxxxxx> wrote:  "Function rejected by user 
exit program NW0001E in PSCOMMON"

Somebody in your company wrote and installed a user exit program that controls 
access to your AS/400 via the entry point that the JDBC driver uses. You should 
ask your co-workers and find out what you have to do.


-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx] On 
Behalf Of Sivakumar Kanagavel
Sent: March 15, 2007 08:51
To: java400-l@xxxxxxxxxxxx
Subject: JDBC Error

I am trying to learn Java and how to access AS/400 data using JDBC and wrote a 
small program :

import java.sql.*; 
public class MyDBRead{ 
public static void main (String argv []){ 
try { 
String sys = "TESTSYS1"; 
String user = "SIVAKUMARK"; 
String pass = "TEXAS1"; 
Connection con = DriverManager.getConnection("jdbc:as400://"+sys,user,pass); 
Statement stm = con.createStatement(); 
ResultSet rs = stm.executeQuery("select FIELD1 from MYFILE");
while( { 
System.out.println(rs.getString(1)); } 
con.close(); } 
catch(Exception e) { 
e.printStackTrace(); } 
} }

The code compiled without any error. While trying to execute, its throwing 
following exceptions. Can someone tell what I am missing here?. Thanks for in 

java.sql.SQLException: [PWS9801] Function rejected by user exit program NW0001E 
java/lang/Throwable.(Ljava/lang/String;)V+4 ( 
java/lang/Exception.(Ljava/lang/String;)V+1 ( 
400JDBCConnection;III)V+0 ( 
cess/JDSQLStatement;)Lcom/ibm/as400/access/JDServerRow;+0 (AS400JDBCStatement
)Ljava/sql/ResultSet;+0 ( 
MyDBRead.main([Ljava/lang/String;)V+0 ( 

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.