Results 1 to 3 of 3
  1. #1
    MAS
    MAS is offline Member
    Join Date
    Apr 2012
    Posts
    2
    Rep Power
    0

    Default java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters.

    Hi All,

    I have a problem..when i want to execute this code

    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:StudentMana gement");
    Statement st = con.createStatement();
    ResultSet rs = st.executeQuery("select stuID from marking where lectName="+lctName);
    if (rs.next()) {
    ID.addItem(rs.getString(1));
    }
    rs.close();
    } catch(Exception ex1) {
    ex1.printStackTrace();;
    }

    i'm getting this error
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc .java:6956)
    at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java :7113)
    at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(JdbcOdbc.java :3109)
    at sun.jdbc.odbc.JdbcOdbcStatement.execute(JdbcOdbcSt atement.java:337)
    at sun.jdbc.odbc.JdbcOdbcStatement.executeQuery(JdbcO dbcStatement.java:252

    All column names in SQL command are matching with all in the database.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,091
    Rep Power
    20

    Default Re: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few paramete

    Your SQL is wrong, unless lectName is a NUMBER field.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    MAS
    MAS is offline Member
    Join Date
    Apr 2012
    Posts
    2
    Rep Power
    0

    Default Re: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few paramete

    thank you
    i have solve the problem
    i am using like statement

Similar Threads

  1. Replies: 6
    Last Post: 12-25-2011, 11:33 PM
  2. Replies: 5
    Last Post: 09-11-2011, 05:13 AM
  3. Replies: 3
    Last Post: 08-15-2011, 10:16 AM
  4. Replies: 2
    Last Post: 08-11-2011, 02:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •