code: public Script addScript(String name, String script) throws Exception {
          int id = -1;
          PreparedStatement statement = null;
          ResultSet results = null;
  
          try (Connection sqlConnection = SQLService.getInstance().getConnection()) {
              statement = sqlConnection.prepareStatement(
                  "INSERT INTO " + Constants.DB_TABLE_SCRIPT
                      + "(" + Constants.SCRIPT_NAME + "," + Constants.SCRIPT_SCRIPT + "," + Constants.SCRIPT_TYPE + ")"
                      + " VALUES (?, ?, ?)", PreparedStatement.RETURN_GENERATED_KEYS
              );
              statement.setString(1, name);
              statement.setString(2, script);
              statement.setInt(3, 0);
              statement.executeUpdate();
  
              // execute statement and get resultSet which will have the generated path ID as the first field
              results = statement.getGeneratedKeys();
  
              if (results.next()) {
                  id = results.getInt(1);
              } else {
                  // something went wrong
                  throw new Exception("Could not add script");
              }
          } catch (SQLException e) {
              throw e;
          } finally {
              try {
                  if (results != null) {
                      results.close();
                  }
              } catch (Exception e) {
              }
              try {
                  if (statement != null) {
                      statement.close();
                  }
              } catch (Exception e) {
              }
          }
  
          return this.getScript(id);
      }
docs: Add a script
  TODO: Make this take type as a param
  
  @param name - name of script
  @param script - script
  @return Newly-added script
  @throws Exception exception