title: check whether a table exists in ms access through jdbc
body: <p>can somebody tell me how can I check whether a table exists in microsoft access by using java database connectivity. After searching I go something like 
      If Not IsNull(DlookUp("Name","MSysObjects","Name='TableName'")) Then
      'Table Exists
  I tried to implement the same thing in jdbc program </p>
  
  <pre><code>import java.sql.*;
  class CheckTable{
  public static void main(String [] rak){
   boolean flag;
   try{
   flag=false;
   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
   String dataSourceName="test"; 
   String dbURL="jdbc:odbc:"+dataSourceName;
   Connection con=DriverManager.getConnection(dbURL,"","");
   Statement s=con.createStatement(); 
  //s.execute("create table xyz (name text, hiredate date)");
  //s.execute("insert into xyz values('xz1','22-dec-2005')");
  // s.execute("insert into xyz values('pr','2-21-2009')");
   s.execute(" If Not IsNull(DlookUp('Name','MSysObjects',"Name='xyz'")) Then "+ flag=true + ");
  
   /* 
        ResultSet rs=s.getResultSet();
    if (rs!=null){
         while(rs.next()){
         System.out.println(rs.getString(1)+rs.getString(2));
        }}
    */      
   }
   catch(Exception e){
      e.printStackTrace();
  }
  System.out.println(" table exists :"+flag);
     }
    }
  </code></pre>
  
  <p>I am getting error at s.execute() statement please help me with the syntax.
  the errors I am getting are:
  ')' expected
  illegal start of expression
  unclosed character literal
  not a statement
  ; excepted 
  all the errors are on line  s.execute(" If Not IsNull(DlookUp('Name','MSysObjects',"Name='xyz'")) Then "+ flag=true + ");</p>