public synchronized void createFile(JDBCSequentialFile file) throws SQLException {
  try {
    connection.setAutoCommit(false);
    createFile.setString(1,file.getFileName());
    createFile.setString(2,file.getExtension());
    createFile.setBytes(3,new byte[0]);
    createFile.executeUpdate();
    try (ResultSet keys=createFile.getGeneratedKeys()){
      keys.next();
      file.setId(keys.getInt(1));
    }
     connection.commit();
  }
 catch (  SQLException e) {
    connection.rollback();
    throw e;
  }
}

public synchronized void createFile ( JDBCSequentialFile file ) throws SQLException { try { connection . setAutoCommit ( false ) ; createFile . setString ( 1 , file . getFileName ( ) ) ; createFile . setString ( 2 , file . getExtension ( ) ) ; createFile . setBytes ( 3 , new byte [ 0 ] ) ; createFile . executeUpdate ( ) ; try ( ResultSet keys = createFile . getGeneratedKeys ( ) ) { keys . next ( ) ; file . setId ( keys . getInt ( 1 ) ) ; } connection . commit ( ) ; } catch ( SQLException e ) { connection . rollback ( ) ; throw e ; } }
creates a new database row representing the supplied file .
