title: Connecting Java with Microsoft Access using ucanaccess
body: <p>When I try to access the insert in the existing database using ucanaccess, it's shows a mean error like this:</p>
  
  <pre><code>Exception in thread "main" net.ucanaccess.jdbc.UcanaccessSQLException: user     lacks privilege or object not found: L
      at net.ucanaccess.jdbc.UcanaccessStatement.executeQuery(UcanaccessStatement.java:202)
      at sequence.FrequencyAnalyser.FrequencyAnalyser(FrequencyAnalyser.java:130)
      at sequence.Sequence.main(Sequence.java:57)
      Caused by: java.sql.SQLSyntaxErrorException: user lacks privilege or object     not found: L
      at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
      at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
      at org.hsqldb.jdbc.JDBCStatement.fetchResult(Unknown Source)
      at org.hsqldb.jdbc.JDBCStatement.executeQuery(Unknown Source)
      at   net.ucanaccess.jdbc.UcanaccessStatement.executeQuery(UcanaccessStatement.java:199)
      ... 2 more
  
       Caused by: org.hsqldb.HsqlException: user lacks privilege or object not   found: L
      at org.hsqldb.error.Error.error(Unknown Source)
      at org.hsqldb.error.Error.error(Unknown Source)
      at org.hsqldb.ParserDQL.readSimpleColumnName(Unknown Source)
      at org.hsqldb.ParserDQL.readSimpleColumnNames(Unknown Source)
      at org.hsqldb.ParserDML.compileInsertStatement(Unknown Source)
      at org.hsqldb.ParserCommand.compilePart(Unknown Source)
      at org.hsqldb.ParserCommand.compileStatements(Unknown Source)
      at org.hsqldb.Session.executeDirectStatement(Unknown Source)
      at org.hsqldb.Session.execute(Unknown Source)
      ... 5 more
      Java Result: 1
  </code></pre>
  
  <h3>My coding part</h3>
  
  <p>Frequency analyser:</p>
  
  <pre><code>    try
      {
          System.out.println("Good here");
          String state="INSERT INTO sequences     (A,C,D,E,F,G,H,I,K,L,M,N,P,Q,R,S,T,V,W,Y,GENE)   VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
          st = odbc.con.createStatement();
          ps = (PreparedStatement) st.executeQuery(state);
          ps.setString(1, (String.valueOf(probability[0])));
  </code></pre>
  
  <h3>Database code:</h3>
  
  <pre><code>    package sequence;
      import java.sql.*;
  
      public class OdbcAccessConnection {
          Statement state;
          Connection con = null;
          public OdbcAccessConnection() throws SQLException, ClassNotFoundException
          {
              try
              {
                  System.out.println("Entered");
                  // Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
  
                  // Connect with a URL string
                  System.out.println("Database connection started...");
                  con = DriverManager.getConnection("jdbc:ucanaccess://F:\\Thiyaga\\Database\\sequences.accdb");
                  System.out.println("Hello satarted");
                  state = con.createStatement();
                  System.out.println("Connection ok.");
  
                  /**
                   *
                   * @param a
                   * @param c
                   * @param d
                   * @param e
                   * @param f
                   * @param g
                   * @param i
                   * @param k
                   * @param l
                   * @param m
                   * @param n
                   * @param p
                   * @param q
                   * @param r
                   * @param s
                   * @param t
                   * @param v
                   * @param y
                   */
  
              }
              catch (SQLException e)
              {
                  System.err.println("Exception: " + e.getMessage());
              }
          }
      }
  </code></pre>
  
  <p>Actually a connection is established!!</p>