Say that I have a JDBC ResultSet, and I call the getLong() or getshort() method.
For which of the following SQL types {SMALLINT, INT, BIGINT} should I get long, and for which types should I get an error?
In other words, if I have an INT and I want a SMALLINT (A short), would I get it, or would I get an error? Similarly, if I have an INT and want a BIGINT (a long), would I get it, or would I get an error?
The Javadocs (listed below) say nothing.
public long getLong(int columnIndex) throws SQLException
Retrieves the value of the designated column in the current rowof this ResultSet object as a long in the Java programming language.
Parameters: columnIndex - the first column is 1, the second is 2, ... Returns: the column value; if the value is SQL NULL, the value returned is 0 Throws: SQLException - if a database access error occurs