Examples of Driver


Examples of java.sql.Driver

        //delete earlier files
        HsqldbTestCase.deleteDir(new File("/hsql/statBase/"));

        try {
            Class  clsDriver = Class.forName("org.hsqldb.jdbc.JDBCDriver");
            Driver driver    = (Driver) clsDriver.newInstance();

            DriverManager.registerDriver(driver);

            Connection con = DriverManager.getConnection(url, props);
            String createQuery =
View Full Code Here

Examples of java.sql.Driver

        if (SOSString.isEmpty(dbpassword)) dbpassword = "";

        properties.setProperty("user", dbuser);
        properties.setProperty("password", dbpassword);

        Driver driver = (Driver) Class.forName(this.driver).newInstance();
        connection = driver.connect(url, properties);
        if (connection == null)
                throw new Exception("can't connect to database");
        versionLimiter.check(this, logger);
        logger.debug6(".. successfully connected to " + url);
View Full Code Here

Examples of java.sql.Driver

            updateAutoCommitBox();

            // Workaround for EXTREME SLOWNESS getting this info from O.
            showIndexDetails = !isOracle;

            Driver driver = DriverManager.getDriver(dMeta.getURL());
            ConnectionSetting newSetting = new ConnectionSetting(
                dMeta.getDatabaseProductName(), driver.getClass().getName(),
                dMeta.getURL(),
                dMeta.getUserName().replaceAll("@localhost", ""), "");
            Hashtable settings =
                ConnectionDialogCommon.loadRecentConnectionSettings();
View Full Code Here

Examples of java.sql.Driver

    public static void test() throws Exception {

        Connection        conn;
        Statement         stmnt;
        PreparedStatement pstmnt;
        Driver            driver;

        driver =
            (Driver) Class.forName("org.hsqldb.jdbc.JDBCDriver").newInstance();

        DriverManager.registerDriver(driver);
View Full Code Here

Examples of java.sql.Driver

    public static void main(String[] args) throws Exception {

        int    runs;
        String db_path;
        Driver driver;

        runs    = def_runs;
        db_path = def_db_path;

        try {
View Full Code Here

Examples of java.sql.Driver

                throw new SQLNestedException(message, t);
            }
        }

        // Create a JDBC driver instance
        Driver driver = null;
        try {
            if (driverFromCCL == null) {
                driver = DriverManager.getDriver(url);
            } else {
                // Usage of DriverManager is not possible, as it does not
                // respect the ContextClassLoader
                driver = (Driver) driverFromCCL.newInstance();
                if (!driver.acceptsURL(url)) {
                    throw new SQLException("No suitable driver", "08001");
                }
            }
        } catch (Throwable t) {
            String message = "Cannot create JDBC driver of class '" +
View Full Code Here

Examples of java.sql.Driver

    throws Exception
  {
    ClassLoader loader = Thread.currentThread().getContextClassLoader();
   
    Class cl = Class.forName(driverClass, false, loader);
    Driver driver = (Driver) cl.newInstance();
   
    return new DataSourceAdapter(driver, url, user, password);
  }
View Full Code Here

Examples of java.sql.Driver

      throw new IllegalStateException();

    if (_driver == null)
      throw new IllegalStateException();

    Driver driver = _driver;
    String url = getURL();

    if (url == null)
      throw new SQLException(L.l("can't create connection with null url"));

    try {
      Properties properties = new Properties();
      properties.putAll(getInfo());

      if (user != null)
        properties.put("user", user);
      else
        properties.put("user", "");

      if (password != null)
        properties.put("password", password);
      else
        properties.put("password", "");

      Connection conn;
      if (driver != null)
        conn = driver.connect(url, properties);
      else
        conn = java.sql.DriverManager.getConnection(url, properties);

      synchronized (this) {
        _connectionCountTotal++;
View Full Code Here

Examples of java.sql.Driver

          continue;

        try {
          Class<?> cl = Class.forName(line, false, loader);

          Driver driver = (Driver) cl.newInstance();

          if (driver.acceptsURL(url))
            return cl.getName();
        } catch (Exception e) {
          log.log(Level.WARNING, e.toString(), e);
        }
      }
View Full Code Here

Examples of java.sql.Driver

        loadDriver();
        String defaultdburl = url + ";create=true";
       
        // Test that we loaded the right driver by making a connection
        Driver driver = DriverManager.getDriver(defaultdburl);
        Properties props = new Properties();
        props.put("user", "testuser");
        props.put("password", "testpass");
        Connection conn = DriverManager.getConnection(defaultdburl, props);
        // Driver should be jdbc compliant.
        assertTrue(driver.jdbcCompliant());

        // compare driver.get*Version() with DatabaseMetadata.getDriver*Version.
        DatabaseMetaData dbmd = conn.getMetaData();

        assertEquals(dbmd.getDriverMajorVersion(), driver.getMajorVersion());
        assertEquals(dbmd.getDriverMinorVersion(), driver.getMinorVersion());

        // test that the driver is one of the special 40 versions if we are running
        // on Java 6 or higher
        println( "Driver is a " + driver.getClass().getName() );
        assertEquals( JDBC.vmSupportsJDBC4(), driver.getClass().getName().endsWith( "40" ) );
       
        conn.close();
    }
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.