java oracle syntax error?

Posted by murali on Stack Overflow See other posts from Stack Overflow or by murali
Published on 2010-06-14T10:56:44Z Indexed on 2010/06/14 11:22 UTC
Read the original article Hit count: 210

Filed under:
|

hi,

i am using the following code for the uploading keywords & count to the excel file. i am having the keyword_id as primary key for that one i had written sentence...i am having the twocolumns in the excel file..1.keyword 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 slove this problem...

© Stack Overflow or respective owner

Related posts about java

Related posts about java-ee