List of usage examples for java.sql CallableStatement getObject
public <T> T getObject(String parameterName, Class<T> type) throws SQLException;
From source file:Test.java
public static void main(String[] args) throws Exception { Connection conn = DriverManager.getConnection("...", "username", "password"); String query = "{CALL GETDATE(?,?)}"; CallableStatement callableStatement = (CallableStatement) conn.prepareCall(query); callableStatement.setInt(1, 123);//w w w . j a va 2 s .c o m callableStatement.registerOutParameter(1, Types.DATE); callableStatement.executeQuery(); Date date = callableStatement.getObject(2, Date.class); }