If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > DB2 JDBC driver question??

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-13-04, 23:20
agilechen agilechen is offline
Registered User
 
Join Date: Jan 2004
Posts: 8
Question DB2 JDBC driver question??

I have a sql statement,
"select * from ITEM_P2P3_QUERY where contains(description, ?) =0"
But I want to replace the ? as '"P*"'.
ect * from ITEM where contains(description, '"P*"') =0
So I can question it in DB2 successfully.
I used ps.setString(1, "P*"); and ps.setString(1, "'\"aa\"'"); to try it. But I got some exception on this.
So my question is how to use DB2 JDBC to convert it that it can be executed successfully.
Reply With Quote
  #2 (permalink)  
Old 01-14-04, 01:35
adam_ac adam_ac is offline
Registered User
 
Join Date: Nov 2003
Location: Jakarta, Indonesia
Posts: 32
Re: DB2 JDBC driver question??

Can you send us the stacktrace

Regards,
Adam AC

Quote:
Originally posted by agilechen
I have a sql statement,
"select * from ITEM_P2P3_QUERY where contains(description, ?) =0"
But I want to replace the ? as '"P*"'.
ect * from ITEM where contains(description, '"P*"') =0
So I can question it in DB2 successfully.
I used ps.setString(1, "P*"); and ps.setString(1, "'\"aa\"'"); to try it. But I got some exception on this.
So my question is how to use DB2 JDBC to convert it that it can be executed successfully.
Reply With Quote
  #3 (permalink)  
Old 01-14-04, 01:40
agilechen agilechen is offline
Registered User
 
Join Date: Jan 2004
Posts: 8
Re: DB2 JDBC driver question??

I just used the Java codes to connect DB2.

}else if(type == CMType.QUERY_QCRONLY) {
result.append(" AND (CONTAINS(A.DESCRIPTION,?) = 1 or CONTAINS(A.QCR_NUMBER,?) = 1) ");
}else if(type == CMType.QUERY_ACTIVITYONLY) {
result.append(" AND (CONTAINS(A.DESCRIPTION,?) = 1 or CONTAINS(A.ACTIVITY_NUMBER,?) = 1) ");
}else if(type == CMType.QUERY_REPORTONLY) {
result.append(" AND (CONTAINS(A.DESCRIPTION,?) = 1 or CONTAINS(A.NAME,?) = 1) ");

ps.setString(1, fullTextExpr);
It will throws some exceptions for setString() method.


Quote:
Originally posted by adam_ac
Can you send us the stacktrace

Regards,
Adam AC
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On