SQL STATE 42601

In my java program I am opening database connection 3-4 times .

This is one of them the same with others but IBM RAD gives error to this code

If I remove try catch block RAD gives error to all lines in try block.

RAD error is this :

Unhandled exception type SQlException

Connection con=null;

Statement stmt_on_kayit =null;

try{

Driver d = (Driver) Class.forName("com.ibm.db2.jcc.DB2Driver").newInstance();

con = DriverManager.getConnection(url, userId, password); stmt_on_kayit = con.createStatement();

rs_check=stmt_on_kayit.executeQuery(sql_counter2);

}catch (Exception e){

System.out.println("XXX Error 1="+ e.toString() );

}

Console log gives this output:

[9/19/06 17:03:56:809 EEST] 59324199 SystemOutO XXX Error 1 =com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -104, SQLSTATE

: 42601, SQLERRMC: ,;MAIN_COUNTER = '970';<space>

Why output writesMAIN_COUNTER = '970';<space> because this is my database table colon name.

And what is my solution?

Any suggestion !!!

[1455 byte] By [M.Alia] at [2007-10-3 5:19:51]
# 1

> Why output writes MAIN_COUNTER =

> '970';<space> because this is my database

> table colon name.

This is a database specific error that tells you something is wrong with what you are sending the database.

>

> And what is my solution?

Fix what you are sending the database. Your SQL is wrong.

jschella at 2007-7-14 23:26:47 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...