title: Insert into Oracle DB using Java
body: <p>I am trying to insert values in a table on  my oracle server, however, the program keeps running and doesn't execute. This is my code:</p>
  
  <p>This is how I connect to the database:</p>
  
  <pre><code>try {
              connection = DriverManager.getConnection(
                      "jdbc:oracle:thin:@abc.xxx.edu:1521:soeorcl","123",
                      "123");
          } catch (SQLException e) {
              System.out.println("Connection Failed! Check output console");
              e.printStackTrace();
              return;
  </code></pre>
  
  <p>Then I try to insert the values in the table:</p>
  
  <pre><code> try {
              PreparedStatement prepareStatement = connection.prepareStatement("INSERT INTO MYTABLE (USERID, USERNAME, EMAILADDRESS, PHONENUMBER, PROFILEPICTURE )"
                      + " VALUES (?, ?, ?, ?, ?)");
              prepareStatement.setString(1, "10");
              prepareStatement.setString(2, "ALI");
              prepareStatement.setString(3, "gdgrgrregeg");
              prepareStatement.setString(4, "0501977498");
              prepareStatement.setNull(5, NULL);
              prepareStatement.execute();
   } catch (SQLException e) {
              System.out.println("IT DOES NOT WORK");
          }
  </code></pre>
  
  <p>The program gets stuck at <code>prepareStatement.execute();</code> I have already checked the constraints and they work if I manually add them on the oracle server but the above code does not work.</p>
  
  <p>Any ideas? Suggestions? </p>