Package org.geotools.jdbc

Examples of org.geotools.jdbc.JDBCTestSetup


        }
       
        // We need to see if we have the citext extension and if we are authorized to
        // create it, to make things easy, we just directly try to do so, if this fails,
        // the test will be skipped
        JDBCTestSetup setup = createTestSetup();
        setup.setFixture(fixture);
       
        Connection cx = null;
        Statement st = null;
        try {
            DataSource dataSource = setup.getDataSource();
            cx = dataSource.getConnection();
            st = cx.createStatement();
            // check if the extension exists, and creates it in the database if needed
            st.execute("create extension if not exists citext");
            st.close();
            cx.close();
            return true;
        }
        catch (Throwable t) {

            return false;
        }
        finally {
            if (st != null) {
              st.close();
          }
          if (cx != null) {
              cx.close();
          }
            try {
                setup.tearDown();   
            }
            catch(Exception e) {
                System.out.println("Error occurred tearing down the test setup");
            }
        }
View Full Code Here

TOP

Related Classes of org.geotools.jdbc.JDBCTestSetup

Copyright © 2018 www.massapicom. 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.