cancel
Showing results for 
Search instead for 
Did you mean: 

AS400 jdbc

Former Member
0 Kudos

does anyone worked with SA400 DB2 Jdbc?

I am trying to use this driver :

com.ibm.as400.access.AS400JDBCDriver

does not work and i get null pointer

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Mushon,

There are two types of DB2 JDBC Drivers are avialble.

1.The "Native" JDBC driver.

Driver:<b>com.ibm.db2.jdbc.app.DB2Driver</b>

Sub protocol:<b>db2</b>

Ex.<b>jdbc:db2:localhost/COLLECTIONNAME</b>

2.The "Toolbox" JDBC driver.

Driver:<b>com.ibm.as400.access.AS400JDBCDriver</b>

Sub protocol:<b>as400</b>

Ex.<b>jdbc:as400://MACHINENAME/COLLECTIONNAME</b>

So can you try with the Native JDBC Driver and protocol.

Regards,

Ananth

Former Member
0 Kudos

Thanks a lot!

Now i get an SQL Exception

my SQL is Select xxx from YYY

the exception says Table name in DB type * file is not found

why?

Former Member
0 Kudos

Hi Mushon,

Can you check whether your xml structure follows the same structure given below.


<StatementName>

<dbTableName action=”SELECT”>

    <table>realDbTableName</table>

<access>

<col1></col1>

<col2></col2>

<col3></col3> 

</access>

<key1>

<col2>val2old</col2>

<col4>val4</col4>

</key1>

<key2>

<col2>val2old2</col2>

</key2>

</dbTableName> 

  </StatementName>

Regards,

Ananth

Former Member
0 Kudos

My JDBC is a sneder in my case and i am doing a select

the error i am getting is in the adapter

Former Member
0 Kudos

Hi Mushon,

Can you try the following SQL in your JDBC Adapter?

SELECT FieldName1 from Table1 where 1=1

Ideally you have to give some conditions to filter the rows which u read already.

Update Statement:

UPDATE Table1 SET FieldName1 = 'SMTHG'

WHERE 1 = 0

This UPDATE statement given above is just to test the SQL and in real time secanrio provide condition for updating the flag to indicate the rows that are fetched by the SELECT statement.

Regards,

Ananth

Former Member
0 Kudos

now i get

TableName in XIUSER type *FILE not found

although the DB admin says it exists

Former Member
0 Kudos

Hi Mushon,

Try to give your Table name as fully qualified name,

i.e, Sehemaname.tablename or username.schema.tablename

Try all the combinations of table names.

If nothing works,

1.Try to write simple Java code to connect to DB2 database and select some rows using JDBC driver and resultset ..

2.Connect using tools like SQL Studio and use the same details in JDBC adapter

Regards,

Ananth

Former Member
0 Kudos

Are you seeing this error in the adapter monitoring?

What is the connection string that you are using ?

it should be like jdbc:as400://<system name>

Thanks,

Renjith.

Former Member
0 Kudos

I get only nullpointer exception

my url is :

jdbc:db2://Server/DB