Created
December 4, 2015 13:36
-
-
Save zdenekoklestek/0df493f76e5f86aa2d3e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Connection connection = null; | |
CallableStatement call = null; | |
try { | |
connection = dataSource.getConnection(); | |
call = connection.prepareCall("{? = call get_entity2 (?)}"); | |
call.registerOutParameter(1, Types.VARCHAR); | |
call.setString(2, tableName); | |
call.executeUpdate(); | |
return call.getString(1); | |
} catch (SQLException e) { | |
throw new RuntimeException(e); | |
} finally { | |
if(call != null) { | |
try { | |
call.close(); | |
} catch (SQLException e) { | |
throw new RuntimeException(e); | |
} | |
} | |
if(connection != null) { | |
try { | |
connection.close(); | |
} catch (SQLException e) { | |
throw new RuntimeException(e); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment