By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,805 Members | 1,392 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,805 IT Pros & Developers. It's quick & easy.

INFO: parametercount: 1. Assertion failure

Expert 100+
P: 1,043
Expand|Select|Wrap|Line Numbers
  1.         PreparedStatement prep = conn.prepareStatement("select sheetname from sheet where i = ?;");
  2.         ParameterMetaData p = prep.getParameterMetaData();
  3.         logger.info("parametercount: " + p.getParameterCount());
  4.         prep.setInt(1, 1);
  5.         prep.addBatch();
  6.         ResultSet rs = prep.executeQuery();
  7.         while (rs.next()) {
  8.             s = rs.getString("sheetname");
  9.         }
  10.         rs.close();
  11.  
when I execute this, I get an error on line 6 of above code:
Expand|Select|Wrap|Line Numbers
  1. INFO: parametercount: 1
  2. Exception in thread "main" java.sql.SQLException: assertion failure: param count (1) != value count (2)
what am I doing wrong... ;)
Apr 20 '13 #1

✓ answered by Luuk

SOLVED!, line 5 should not have been there....

Share this Question
Share on Google+
1 Reply


Expert 100+
P: 1,043
SOLVED!, line 5 should not have been there....
Apr 20 '13 #2

Post your reply

Sign in to post your reply or Sign up for a free account.