title: Neo4j type mismatch
body: <p>I am trying to write a JDBC code in eclipse that connects to neo4j. I can get it to connect to the database, but I am having troubles getting the queries to run. I have the Neo4J driver jar imported as well as most of the driver imports needed. This being said, I am still getting errors in two places:</p>
  
  <pre><code>PreparedStatement statement = conn.prepareStatement(cypher);
  </code></pre>
  
  <p>gives me the error:</p>
  
  <p>Multiple markers at this line</p>
  
  <pre><code>- The method prepareStatement(String) is undefined for the type Connection
  
  - Type mismatch: cannot convert from java.sql.PreparedStatement to org.neo4j.jdbc.PreparedStatement
  </code></pre>
  
  <p>I am confused why java.sql is included because I don't have it imported into this class.</p>
  
  <p>My other error is at line: </p>
  
  <p>Connection conn = DriverManager.getConnection("jdbc:neo4j:bolt://localhost", "", "");</p>
  
  <p>The error I get here is: DriverManager cannot be resolved.</p>
  
  <p>My code (unfinished) is below. My question is, what I should do to help resolve these errors.</p>
  
  <pre><code>private static void runCypher(Connection conn, String cypher) {
      PreparedStatement statement = conn.prepareStatement(cypher);
  
  
  }
  
  public static void main (String[] args) {
      try {   
          Connection conn = DriverManager.getConnection("jdbc:neo4j:bolt://localhost", "", "");
  
          String cypher = "";
          String option = "";
          String instr = "Enter a: Show distinct sids and snames of suppliers who supply a red part or a green part." + "\n"
                  + "Enter b: Show distinct sids and snames of suppliers who supply a red part and a green part."
                  + "\n" + "Enter c: Insert a new supplier." + "\n"
                  + "Enter d:  Quit Program.";
  
      while (true) {
          option = JOptionPane.showInputDialog(instr);
          if (option.equals("a")) {
              cypher = "match (s:Suppliers)-[:supplies]-&gt;(p:Parts) where p.color = ‘red’ or p.color = ‘green’ return distinct s.sid, s.sname;";
              runCypher(conn, cypher);
          } else if (option.equalsIgnoreCase("b")) {
              cypher = "match (p1:Parts)&lt;-[:supplies]-(s:Suppliers)-[:supplies]-&gt;(p2:Parts) where p1.color = ‘red’ and p2.color = ‘green’ return distinct s.sid, s.sname;";
              runCypher(conn, cypher);
          } else if (option.equals("c")) {
              cypher = "match (p:Parts)&lt;-[sup:supplies]-(s:Suppliers) return p.pid, p.pname, max(toInteger(sup.cost)) order by p.pid;";
              runCypher(conn, cypher);
          } else {
              break;
          }
  
  
      }}catch(Exception e ) {
          System.out.println("Program terminates due to errors");
          e.printStackTrace(); // for debugging
      }
  }
  </code></pre>
  
  <p>My imports:</p>
  
  <pre><code>import org.neo4j.driver.internal.spi.Connection;
  import org.neo4j.driver.v1.StatementResult;
  import org.neo4j.jdbc.PreparedStatement;
  import org.neo4j.jdbc.ResultSet;
  import org.neo4j.jdbc.ResultSetMetaData;
  </code></pre>