1 16 package scriptella; 17 18 import scriptella.execution.EtlExecutor; 19 import scriptella.execution.EtlExecutorException; 20 import scriptella.jdbc.QueryHelper; 21 import scriptella.spi.ParametersCallback; 22 import scriptella.spi.QueryCallback; 23 24 import java.sql.Connection ; 25 import java.sql.Timestamp ; 26 27 28 34 public class JDBCEscapingTest extends DBTestCase { 35 40 public void testTimestamps() throws EtlExecutorException { 41 final Connection c = getConnection("jdbcet"); 42 final EtlExecutor se = newEtlExecutor(); 43 se.execute(); 44 45 QueryHelper q = new QueryHelper("select * from test"); 46 final Timestamp expectedTs = Timestamp.valueOf("2005-10-10 22:33:44.1"); 47 q.execute(c, 48 new QueryCallback() { 49 public void processRow(final ParametersCallback rowEvaluator) { 50 final Timestamp ts = (Timestamp ) rowEvaluator.getParameter( 51 "d"); 52 assertEquals(expectedTs, ts); 53 } 54 }); 55 } 56 } 57 | Popular Tags |