use of com.ctrip.platform.dal.dao.client.DalConnection in project dal by ctripcorp.
the class DalConnectionTest method testClose.
@Test
public void testClose() throws SQLException {
Connection conn = null;
try {
DalConnection test = getConnection();
Statement statement = test.getConn().createStatement();
ResultSet rs = statement.executeQuery("select * from " + SqlServerTestInitializer.TABLE_NAME);
rs.next();
conn = test.getConn();
test.close();
assertTrue(conn.isClosed());
} catch (Throwable e) {
fail();
e.printStackTrace();
} finally {
if (conn != null)
conn.close();
}
}
use of com.ctrip.platform.dal.dao.client.DalConnection in project dal by ctripcorp.
the class DalConnectionTest method testDalConnection.
@Test
public void testDalConnection() throws SQLException {
Connection conn = null;
try {
DalConnection test = getConnection();
assertNotNull(test);
} catch (Throwable e) {
fail();
e.printStackTrace();
} finally {
if (conn != null)
conn.close();
}
}
use of com.ctrip.platform.dal.dao.client.DalConnection in project dal by ctripcorp.
the class DalConnectionTest method testGetConn.
@Test
public void testGetConn() throws SQLException {
Connection conn = null;
try {
DalConnection test = getConnection();
assertNotNull(test.getConn());
} catch (Throwable e) {
fail();
e.printStackTrace();
} finally {
if (conn != null)
conn.close();
}
}
use of com.ctrip.platform.dal.dao.client.DalConnection in project dal by ctripcorp.
the class DalConnectionTest method testGetCatalog.
@Test
public void testGetCatalog() throws SQLException {
Connection conn = null;
try {
DalConnection test = getConnection();
assertNotNull(test.getDatabaseName());
} catch (Throwable e) {
fail();
e.printStackTrace();
} finally {
if (conn != null)
conn.close();
}
}
use of com.ctrip.platform.dal.dao.client.DalConnection in project dal by ctripcorp.
the class DalConnectionTest method testGetMeta.
@Test
public void testGetMeta() throws SQLException {
Connection conn = null;
try {
DalConnection test = getConnection();
assertNotNull(test.getMeta());
LogEntry entry = new LogEntry();
assertNotNull(test.getMeta());
test.getMeta().populate(entry);
assertNotNull(test.getMeta());
} catch (Throwable e) {
fail();
e.printStackTrace();
} finally {
if (conn != null)
conn.close();
}
}
Aggregations