title: How to insert a value in a table Oracle in SQL Developer using JDBC
body: <p>I want to insert a row in a table in Oracle SQL Developer. I have a set of Strings, <code>String name</code>, <code>String address</code>, and <code>String contact</code>. </p>
  
  <p>It won't work if I use this code:</p>
  
  <pre><code>Connection conn = null;
  Statement stmt = null;
  String URL = "jdbc:oracle:thin:mariel@//localhost:1521/XEXDB";
  String USER = "mariel";
  String PASS = "1234";
  String name = "a", address = "a", contact="a";
  
  try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    try {
      conn = DriverManager.getConnection(URL, USER, PASS);
      stmt = conn.createStatement();
  
      String sql = "INSERT INTO CUSTOMER" +
                   "VALUES(CustNumSeq.NEXTVAL, name, address, contact)";
      stmt.executeUpdate(sql);
    } 
    catch (SQLException ex) {
                 Logger.getLogger(FinishTransaction.class.getName()).log(Level.SEVERE, null, ex);
    }
  }
  catch(ClassNotFoundException ex) {
     System.out.println("Error: unable to load driver class!");
     System.exit(1);
  }
  finally{
     try{
       if(stmt!=null)
          stmt.close();
     }
     catch(SQLException se2){
     }
     try{
        if(conn!=null)
        conn.close();
     }
     catch(SQLException se){
        se.printStackTrace();
     }
  }
  </code></pre>