create a global jdbc connection in scala to run multiple queries
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
0
I am trying to create a code that basically creates a jdbc connection (only once) to the run a certain function n times. How would this be possible? I have tried something like this: class conn(name: String) { DriverManager.registerDriver(new OracleDriver()) val conn = DriverManager.getConnection("jdbc:oracle:thin:@rest_of_the_link", "user", "pass") var output : Int; def spArray() : Int = { var callableStatement: CallableStatement = conn.prepareCall("Statement_to_run;") callableStatement.registerOutParameter(1,Types.INTEGER) callableStatement.execut