Examples of canUnwrap()


Examples of org.geotools.data.jdbc.datasource.UnWrapper.canUnwrap()

       ds.setAccessToUnderlyingConnectionAllowed(true);
      
       Connection conn = ds.getConnection();
       UnWrapper uw = DataSourceFinder.getUnWrapper(conn);
       assertNotNull(uw);
       assertTrue(uw.canUnwrap(conn));
       Connection unwrapped = uw.unwrap(conn);
       assertNotNull(unwrapped);
       assertTrue(unwrapped instanceof org.h2.jdbc.JdbcConnection);
      
       Statement st = conn.createStatement();
View Full Code Here

Examples of org.geotools.data.jdbc.datasource.UnWrapper.canUnwrap()

       assertTrue(unwrapped instanceof org.h2.jdbc.JdbcConnection);
      
       Statement st = conn.createStatement();
       uw = DataSourceFinder.getUnWrapper(st);
       assertNotNull(uw);
       assertTrue(uw.canUnwrap(st));
       Statement uwst = uw.unwrap(st);
       assertNotNull(uwst);
       assertTrue(uwst instanceof org.h2.jdbc.JdbcStatement);
       st.close();
      
View Full Code Here

Examples of org.geotools.data.jdbc.datasource.UnWrapper.canUnwrap()

       st.close();
      
       PreparedStatement ps = conn.prepareStatement("select curtime()");
       uw = DataSourceFinder.getUnWrapper(ps);
       assertNotNull(uw);
       assertTrue(uw.canUnwrap(ps));
       PreparedStatement uwps = (PreparedStatement) uw.unwrap(ps);
       assertNotNull(uwps);
       assertTrue(uwps instanceof org.h2.jdbc.JdbcPreparedStatement);
       ps.close();
      
View Full Code Here

Examples of org.geotools.data.jdbc.datasource.UnWrapper.canUnwrap()

       
        assertSame( connection, unwrap );
       
        UnWrapper unwrapper = new GenericUnWrapper();
       
        assertFalse( unwrapper.canUnwrap( wrapper ) );
        try {
            assertNull( unwrapper.unwrap( wrapper ));
            fail("Cannot unwrap yet");
        }
        catch (Exception expected){
View Full Code Here

Examples of org.geotools.data.jdbc.datasource.UnWrapper.canUnwrap()

        catch (Exception expected){
        }
        GenericUnWrapper.CONNECTION_METHODS.put(WrapperConnection.class,
                WrapperConnection.class.getMethod("getUnderlyingConnection", null));
       
        assertTrue( unwrapper.canUnwrap( wrapper ) );
        assertSame( connection, unwrapper.unwrap( wrapper ) );
    }

    @Test
    public void testSPIRegistration() throws Exception {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.