1 6 package org.logicalcobwebs.proxool; 7 8 import java.sql.Connection ; 9 import java.sql.DriverManager ; 10 import java.sql.ResultSet ; 11 import java.sql.ResultSetMetaData ; 12 import java.sql.SQLException ; 13 import java.sql.Statement ; 14 import java.util.Properties ; 15 16 24 public class PropertyTest extends AbstractProxoolTest { 25 26 public PropertyTest(String alias) { 27 super(alias); 28 } 29 30 39 public void testDelegateProperty() throws Exception { 40 41 String testName = "delegateProperty"; 42 String alias = testName; 43 44 String url = TestHelper.buildProxoolUrl(alias, 46 TestConstants.HYPERSONIC_DRIVER, 47 TestConstants.HYPERSONIC_TEST_URL); 48 Properties info = new Properties (); 49 info.setProperty(ProxoolConstants.USER_PROPERTY, TestConstants.HYPERSONIC_USER); 50 info.setProperty(ProxoolConstants.PASSWORD_PROPERTY, TestConstants.HYPERSONIC_PASSWORD); 51 info.setProperty(ProxoolConstants.HOUSE_KEEPING_TEST_SQL_PROPERTY, TestConstants.HYPERSONIC_TEST_SQL); 52 53 Connection c = null; 54 try { 55 c = DriverManager.getConnection(url, info); 56 Statement s = c.createStatement(); 57 try { 58 s.execute("drop table z"); 59 } catch (SQLException e) { 60 } 62 s.execute("create table z (a int)"); 63 64 s.execute("select * from z"); 65 ResultSet rs = s.getResultSet(); 66 ResultSetMetaData rsmd = rs.getMetaData(); 67 rsmd.isWritable(1); 69 } finally { 70 if (c != null) { 71 c.close(); 72 c = null; 73 } 74 } 75 99 100 } 101 } 102 | Popular Tags |