I am using the following code for uploading keywords & count to an Excel file. I am having the keyword_id as primary key for that one. I am having the two columns in the Excel file. 1.keyword and 2.count
my code is:
while (rs.next()) {
System.out.println("inside ");
String keyword = rs.getString(1);
int count = rs.getInt(2);
System.out.println("insert into SEARCHABLE_KEYWORDS values ('"+
keyword+"','"+count+"')");
stmtdb.execute("insert into SEARCHABLE_KEYWORDS (keyword_id,keyword,count) values ('"+
"select Searchable_Keywords_sequence.nextval from dual"+
"','"+keyword+"','"+count+"')");
System.out.println(keyword + " " + keyword+" count "+count);
}
but I am getting the following error:
java.sql.SQLException: [Microsoft][ODBC Excel Driver] Too few parameters. Expected 1.
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6998)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7155)
at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(JdbcOdbc.java:3151)
at sun.jdbc.odbc.JdbcOdbcStatement.execute(JdbcOdbcStatement.java:378)
at sun.jdbc.odbc.JdbcOdbcStatement.executeQuery(JdbcOdbcStatement.java:284)
at keywordsreader.main(keywordsreader.java:42)
please help to solve this problem...