title: UCanAccess error - net.ucanaccess.jdbc.UcanaccessSQLException: incompatible data type in operation: ; in LIMIT, OFFSET or FETCH
body: <p>I am new to UCanAccess and am using it in the place of reinstalling Microsoft Office from 32-bit to 64-bit or Netbeans 8.0.2 from 64-bit to 32-bit. </p>
  
  <p>I am running a simple program to connect to a small database and display results from it; however I have run into an error that <strong><em>Google</em></strong> has only 5 results for when I search.</p>
  
  <p>Here is my whole DB class:</p>
  
  <pre><code>package highscoresproj;
  
  import java.io.File;
  import java.sql.*;
  
  public class DB
  {
  
      private Connection connection;
      private PreparedStatement statement;
      private ResultSet resultSet;
  
      public DB()
      {
          //load driver
  
          try
          {
              Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
              System.out.println("Driver successfully loaded");
          } catch (ClassNotFoundException c)
          {
              System.out.println("Unable to load driver\n" + c);
          }
  
          //connect to database
          try
          {
              connection = DriverManager.getConnection("jdbc:ucanaccess://"+ getDatabaseLocation("HighScores.accdb")+ ";showschema=true");
              System.out.println("Connection successful");
          } catch (SQLException e)
          {
              System.out.println("Unable to connect\n" + e);
          }
      }
  
      public ResultSet query(String stmt) throws SQLException
      {
          statement = connection.prepareStatement(stmt);
          resultSet = statement.executeQuery();
          return resultSet;
      }
  
      public void update(String update) throws SQLException
      {
          statement = connection.prepareStatement(update);
          statement.executeUpdate();
          statement.close();
      }
  
      public static String getDatabaseLocation(String relativePath)
      {
  
          File dbFile = new File(relativePath);
          String path = dbFile.getAbsolutePath();
          path = path.replaceAll("\\\\", "/");
          System.out.println("DB Full path:\t" + path);
          return path;
      }
  }
  </code></pre>
  
  <p>And the method that runs when I press the button to display the top scores:</p>
  
  <pre><code>private void btnDisplayMaxActionPerformed(java.awt.event.ActionEvent evt)                                              
  {                                                  
      try
      {
          res = db.query("SELECT TOP Username, Score FROM tblUser INNER JOIN tblScores ON UserID = ID");
      } 
      catch (SQLException ex)
      {
          System.out.println("An error occured. Error Message:\n" + ex);
      }
  }
  </code></pre>
  
  <p>When I run the program and press the button, I get the following output:</p>
  
  <pre><code>run:
  Driver successfully loaded
  DB Full path:   C:/Users/Aaron/Documents/Somerset College/IT/Java Book/Excersises/P148 Ex5/HighScoresProj/HighScores.accdb
  Connection successful
  An error occured. Error Message:
  net.ucanaccess.jdbc.UcanaccessSQLException: incompatible data type in operation: ; in LIMIT, OFFSET or FETCH
  BUILD SUCCESSFUL (total time: 11 seconds)
  </code></pre>
  
  <p>Please forgive me if this is a very simple error, but I could not find anywhere specifically mentioning it. Thank you!</p>