File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 3829


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]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Statement parameter 1 not set. is coming