dataSource = (DataSource) jndiContext.lookup("java:comp/env/jdbc/hello_world");
}
else
{
// use faster DataSource impl
HikariDataSource ds = new HikariDataSource();
ds.setJdbcUrl("jdbc:mysql://localhost:3306/hello_world?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useUnbufferedInput=false&useReadAheadInput=false&maintainTimeStats=false&useServerPrepStmts&cacheRSMetadata=true");
ds.setDriverClassName("com.mysql.jdbc.Driver");
ds.setUsername("benchmarkdbuser");
ds.setPassword("benchmarkdbpass");
dataSource = ds;
}
} catch (Exception x)
{
throw new RuntimeException("Cannot create the data source", x);