Obtain a connection that implements the DataSource interface
Description: Enable compatible use of JdbcCleanConn from outside a J2EE app container
8990919293949596979899
try { Class.forName(mDbDriver); server = HsqldbUtil.startHsqldb(_dbFileName, "defaultReplyEprDB"); _dbConn = new JdbcCleanConn (new SimpleDataSource(mDbDriver,mDbUrl,mDbUsername,mDbPassword)); createMessageTable("foo"); createMessageTable("foo_reply_table"); } catch (Exception e) {
7071727374757677787980
di.setSqlFiles(TEST_STRING); assertEquals(di.getSqlFiles(), TEST_STRING); } public void testInitialization() { SimpleDataSource simpleDS = new SimpleDataSource(mDbDriver, mDbUrl, mDbUsername, mDbPassword); // Grab the connection created and do a simple Query - we expect a result try { Context ctx = new InitialContext(); ctx.rebind(JNDI_DATASOURCE, simpleDS);
543544545546547548549550551552553
*/ protected JdbcCleanConn getDbConn() { DataSource oDS = null; if (null == _dbConn) { if (_datasource == null) { oDS = new SimpleDataSource(_driver, _url, _user, _password); } else { InitialContext initContext; try { initContext = new InitialContext();
199200201202203204205
/* * extracted this method to simplify testing. DanielB */ protected JdbcCleanConn createJdbcCleanConnection() { return new JdbcCleanConn(new SimpleDataSource(m_sDriver, m_sURL, m_sUser, m_sPwd)); }