but watch out for this….
Long nullLong = null;
preparedStatement.setLong( nullLong );
-thows null pointer exception-
because the protype is
setLong( long )
NOT
setLong( Long )
nice one to catch you out eh.
More Related Contents:
- PreparedStatement IN clause alternatives?
- PreparedStatement with list of parameters in a IN clause [duplicate]
- Using setDate in PreparedStatement
- Java: Insert multiple rows into MySQL with PreparedStatement
- How can I get the SQL of a PreparedStatement?
- Using “like” wildcard in prepared statement
- Get query from java.sql.PreparedStatement [duplicate]
- How does a PreparedStatement avoid or prevent SQL injection?
- Variable column names using prepared statements
- Reusing a PreparedStatement multiple times
- Where’s my invalid character (ORA-00911)
- Getting java.sql.SQLException: Operation not allowed after ResultSet closed
- right syntax to use near ‘?’
- How does Java’s PreparedStatement work?
- Does the preparedStatement avoid SQL injection? [duplicate]
- mysql prepared statement error: MySQLSyntaxErrorException
- Oracle’s RETURNING INTO usage in Java (JDBC, Prepared Statement)
- How to use prepared statement for select query in Java?
- JDBC Prepared Statement . setDate(….) doesn’t save the time, just the date.. How can I save the time as well?
- PreparedStatement and setTimestamp in oracle jdbc
- com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
- Show JDBC ResultSet in HTML in JSP page using MVC and DAO pattern
- Solving a “communications link failure” with JDBC and MySQL [duplicate]
- How to establish a connection pool in JDBC?
- Why does autoReconnect=true not seem to work?
- How does Class.forName() work?
- JDBC returning MySQLSyntaxError Exception with correct statement
- Adding jdbc driver to classpath
- Connection cannot be cast to oracle.jdbc.OracleConnection
- Performance of MySQL Insert statements in Java: Batch mode prepared statements vs single insert with multiple values