title: Why my data cannot be insert into database?
body: <p>I cannot save the input into my database. Can anybody help me?
  There's SSL problem but it is able to solve by setting SSL to false, but the data seems like only able to read but not save into my database.</p>
  <pre><code>package first;
  
  import java.sql.DriverManager;
  import java.sql.PreparedStatement;
  import java.sql.Connection;
  import javax.swing.JOptionPane;
  
  public class CustomersForm extends javax.swing.JFrame {
      public CustomersForm() {
          initComponents();
      }
  
      private void jButton_addcusActionPerformed(java.awt.event.ActionEvent evt) {
          // TODO add your handling code here:
          try {
              Class.forName(&quot;com.mysql.jdbc.Driver&quot;);
              String connectionURL = &quot;jdbc:mysql://localhost:3308/java_his_db&quot;;
              Connection con = DriverManager.getConnection(connectionURL, &quot;root&quot;, &quot;&quot;);
              String sql = &quot;Insert into customers ('fname') values (?)&quot;;
              PreparedStatement ps = con.prepareStatement(sql);
              ps.setString(2, jTextField_fname.getText());
              ps.executeUpdate();
              System.out.println(&quot;YES&quot;);
              con.close();
          }
          catch(Exception e){
              JOptionPane.showMessageDialog(rootPane, &quot;Blank or Wrong User Profile&quot;, &quot;Insert Error&quot;, 2);
          }  
      }                                                         
  
      private void jTextField_fnameActionPerformed(java.awt.event.ActionEvent evt) {                                                 
          // TODO add your handling code here:
      }
  </code></pre>