title: error: cannot find symbol PreparedStatement
body: <p>I keep getting the following error:</p>
  
  <pre><code>error: cannot find symbol PreparedStatement st = conn.prepareStatement("SELECT * FROM table WHERE name = ?");
  symbol: variable conn
  location: class splitString
  </code></pre>
  
  <p>Here's the code I'm using</p>
  
  <pre><code>import java.sql.Connection;
  import java.sql.DriverManager;
  import java.sql.PreparedStatement;
  import java.sql.ResultSet;
  
  class splitString {
    public static void main(String[] args) {
  
    //Connect to database
      try {
         Class.forName("org.postgresql.Driver"); 
         Connection con = DriverManager.getConnection("jdbc:postgresql://localhost/database", "postgres", "pswd");
         if (con != null)
             System.out.println("Connection Successful!");
      } catch(Exception ee) {
          ee.printStackTrace();
      }
  
      String word = "Apples";
      PreparedStatement st = conn.prepareStatement("SELECT * FROM table WHERE name = ?");
      st.setString(1, word);
      ResultSet rs = st.executeQuery();
  
    }
  }
  </code></pre>
  
  <p>I want to look up the word "Apples" in the database using the variable named "word".</p>
  
  <p>Can someone tell me what I'm doing wrong?</p>