This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Statement parameter 1 not set. is coming Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Statement parameter 1 not set. is coming" Watch "Statement parameter 1 not set. is coming" New topic
Author

Statement parameter 1 not set. is coming

rakesh kopperapu
Greenhorn

Joined: Oct 17, 2008
Posts: 8
String path = "%"+product_part_selected+"%";
try {
if(searchby.equalsIgnoreCase("code")){
System.out.println("in code");
result=getPersistenceEngine().retrieve(Criteria.PRODUCT_CODE_PART_SELECTED, new Object[] { path });
}else if(searchby.equalsIgnoreCase("category")){
System.out.println("in category");
result = getPersistenceEngine().retrieve(Criteria.PRODUCT_CATEGORY_PART_SELECTED, new Object[] { path });
}else if(searchby.equalsIgnoreCase("brand")){
System.out.println("in brand"+path);
result = getPersistenceEngine().retrieve(Criteria.PRODUCT_BRAND_PART_SELECTED, new Object[] { path });
}
} catch (Exception e) {
e.printStackTrace();
}

---------------------------------------------------------
here path is a string,i am passing path as a parameter to query
in if block query is working ,in this query for code i am passing parameter[code is a string and parametr is also a string]
but in else block for category i am passing parameter[category is bigint and parameter is again string]
so how can we pass String to bigint
so my problem will solve if i convert String into bigint[i am using mySql]
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3817


so my problem will solve if i convert String into bigint

Take a look at the API for BigInteger which has a constructor



SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
 
wood burning stoves
 
subject: Statement parameter 1 not set. is coming
 
Similar Threads
Client/Server passing objects
ASP with JavaScript
how to add the result to list
why the program keep looping
cast from string to integer