Changeset 3592 for XerialJ/trunk/sqlite-jdbc
- Timestamp:
- 09/16/09 17:09:31 (3 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
XerialJ/trunk/sqlite-jdbc/src/test/java/org/sqlite/SQLitePureJavaTest.java
r3274 r3592 28 28 29 29 @Before 30 public void setUp() throws Exception 31 { 30 public void setUp() throws Exception { 32 31 System.setProperty("sqlite.purejava", "true"); 33 32 connection = null; … … 38 37 39 38 @After 40 public void tearDown() throws Exception 41 { 39 public void tearDown() throws Exception { 42 40 if (connection != null) 43 41 connection.close(); 42 43 System.setProperty("sqlite.purejava", "false"); 44 44 } 45 45 46 46 @Test 47 public void query() throws ClassNotFoundException 48 { 47 public void query() throws ClassNotFoundException { 49 48 //_logger.debug(String.format("running in %s mode", SQLiteJDBCLoader.isNativeMode() ? "native" : "nested")); 50 49 51 50 assertTrue(SQLiteJDBCLoader.isNativeMode() == false); 52 51 53 try 54 { 52 try { 55 53 Statement statement = connection.createStatement(); 56 54 statement.setQueryTimeout(30); // set timeout to 30 sec. … … 61 59 62 60 ResultSet rs = statement.executeQuery("select * from person order by id"); 63 while (rs.next()) 64 { 61 while (rs.next()) { 65 62 // read the result set 66 63 int id = rs.getInt(1); … … 68 65 } 69 66 } 70 catch (SQLException e) 71 { 67 catch (SQLException e) { 72 68 // if e.getMessage() is "out of memory", it probably means no 73 69 // database file is found … … 77 73 78 74 @Test 79 public void function() throws SQLException 80 { 75 public void function() throws SQLException { 81 76 assertTrue(SQLiteJDBCLoader.isNativeMode() == false); 82 77 83 78 Function.create(connection, "total", new Function() { 84 79 @Override 85 protected void xFunc() throws SQLException 86 { 80 protected void xFunc() throws SQLException { 87 81 int sum = 0; 88 82 for (int i = 0; i < args(); i++)


