Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 172101 - java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few para...
Product: db
Classification: Unclassified
Component: Code
All All
: P2 (vote)
: 6.x
Assigned To: Jiri Rechtacek
Depends on:
  Show dependency treegraph
Reported: 2009-09-13 15:01 UTC by javanus
Modified: 2009-09-23 20:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT

access db (7.14 KB, application/x-compressed)
2009-09-14 20:00 UTC, javanus

Note You need to log in before you can comment on or make changes to this bug.
Description javanus 2009-09-13 15:01:42 UTC

I am using MS Access database. East european characters are also used for column names. I got the following error when 
I query this table: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
The error occurs only while using Netbeans 6.7. It works on Netbeans 6.5 and if I running the application from jar. 

How to repeat an error:
1.create table "test" in Ms access
2.the table should have the field "vpisna številka" as string
3.perform a query on this table (select * from test where [vpisna številka] = '1111'

Below is the error stack:
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
        at sun.jdbc.odbc.JdbcOdbc.createSQLException(
        at sun.jdbc.odbc.JdbcOdbc.standardError(
        at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(
        at sun.jdbc.odbc.JdbcOdbcStatement.execute(
        at sun.jdbc.odbc.JdbcOdbcStatement.executeQuery(
        at grid.SQL2TableModel.executeQuery(
Comment 1 Jiri Prox 2009-09-14 08:22:48 UTC
I'm not sure if we can do anything about it on netbeans side, the exception comes from the driver, 
reassigning to db module
Comment 2 Jiri Rechtacek 2009-09-14 13:00:47 UTC
I don't know what grid.SQL2TableModel is. It seems as a 3rd party module, not is DB tooling module suite. If I'm wrong,
add more information like messages.log, what driver are you using, more details where start in IDE to reproduce this
problem. Thanks
Comment 3 javanus 2009-09-14 20:00:45 UTC
Created attachment 87648 [details]
access db
Comment 4 javanus 2009-09-14 20:04:17 UTC

grid.SQL2TableModel is my class used to read data from db to table model. The error occurs at statement.executeQuery. 
I have prepare a test case. Please create a new project in netbeans 6.5 and create a new java class with the code 
below. Access db is in the attachment. Please do not forget to modify the path to the database in the java code. 
Please run this code in netbeans 6.5 and 6.7. Does it work in 6.7?

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.logging.Level;
import java.util.logging.Logger;

 * @author pmihelic
public class Main {

     * @param args the command line arguments
    public static void main(String[] args) {
        try {
            Connection iDbConn;
            String url = "jdbc:odbc:Driver={Microsoft Access Driver 

            iDbConn = DriverManager.getConnection(url);

            Statement statement = iDbConn.createStatement();
            ResultSet resultSet = statement.executeQuery("SELECT * FROM test_table WHERE [vpisna številka]='blabla'");
            while ( {
                System.out.println("test=" + resultSet.getString(1));
        } catch (SQLException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);



Best regards,
Comment 5 javanus 2009-09-20 21:31:45 UTC

I found out that the value for Keywords is INCOMPLETE. Should I add any other neccessary information?

Comment 6 Jiri Rechtacek 2009-09-21 12:44:43 UTC
Hi Primoz, I understand the problem now but I'm afraid I can help here. The problem is non-unicode encoding in your
example. Consult Access documentation how to set other encoding for that DB. There is no NetBeans IDE's code which could
be changed/fixed to pass your example.
Comment 7 javanus 2009-09-23 20:14:44 UTC

I have only two questions more:
1.Could you open the example in NB 6.5. Does it work?
2.What has changed in NB 6.7 regarding NB 6.5?


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo