// The "?" indicate where the parameters go
String sql="INSERT INTO Movies (title, year, genre, length) VALUES(?,?,?,?)";
PreparedStatment pstmt=con.prepareStatement(sql);
pstmt.clearParameters(); // not needed here
pstmt.setString(1, title); // one- (not zero-)based offsets
pstmt.setInt(2, year);
pstmt.setString(3, genre);
pstmt.setInt(4, length);
// no rows are returned, thus we use executeUpdate()
int numRowsChanged = pstmt.executeUpdate();
Note: You can use column names instead of position indexes in the getXXX() and setXXX() methods