Examples of JdbcConnectionSource


Examples of com.j256.ormlite.jdbc.JdbcConnectionSource

public class PostgresDatabaseTypeTest extends BaseJdbcDatabaseTypeTest {

  @Override
  protected void setDatabaseParams() throws SQLException {
    databaseUrl = "jdbc:postgresql:ormlitepostgres";
    connectionSource = new JdbcConnectionSource(DEFAULT_DATABASE_URL);
    databaseType = new PostgresDatabaseType();
  }
View Full Code Here

Examples of com.j256.ormlite.jdbc.JdbcConnectionSource

  @Test
  public void testCreateDbTypeDataSource() throws Exception {
    ConnectionSource dataSource = null;
    try {
      String dbUrl = "jdbc:h2:mem:ormlitetest";
      dataSource = new JdbcConnectionSource(dbUrl, new H2DatabaseType());
      dataSource.close();
    } finally {
      if (dataSource != null) {
        dataSource.getReadOnlyConnection().close();
      }
View Full Code Here

Examples of com.j256.ormlite.jdbc.JdbcConnectionSource

public class Db2DatabaseTypeTest extends BaseJdbcDatabaseTypeTest {

  @Override
  protected void setDatabaseParams() throws SQLException {
    databaseUrl = "jdbc:db2:ormlitedb2";
    connectionSource = new JdbcConnectionSource(DEFAULT_DATABASE_URL);
    databaseType = new Db2DatabaseType();
  }
View Full Code Here

Examples of com.j256.ormlite.jdbc.JdbcConnectionSource

    // turn our static method into an instance of Main
    new ForeignCollectionMain().doMain(args);
  }

  private void doMain(String[] args) throws Exception {
    JdbcConnectionSource connectionSource = null;
    try {
      // create our data source
      connectionSource = new JdbcConnectionSource(DATABASE_URL);
      // setup our database and DAOs
      setupDatabase(connectionSource);
      // read and write some data
      readWriteData();
      System.out.println("\n\nIt seems to have worked\n\n");
    } finally {
      // destroy the data source which should close underlying connections
      if (connectionSource != null) {
        connectionSource.close();
      }
    }
  }
View Full Code Here

Examples of com.j256.ormlite.jdbc.JdbcConnectionSource

    // turn our static method into an instance of Main
    new DataPersisterMain().doMain(args);
  }

  private void doMain(String[] args) throws Exception {
    JdbcConnectionSource connectionSource = null;
    try {
      // create our data-source for the database
      connectionSource = new JdbcConnectionSource(DATABASE_URL);
      // setup our database and DAOs
      setupDatabase(connectionSource);
      // read and write some data
      readWriteData();
      System.out.println("\n\nIt seems to have worked\n\n");
    } finally {
      // destroy the data source which should close underlying connections
      if (connectionSource != null) {
        connectionSource.close();
      }
    }
  }
View Full Code Here

Examples of com.j256.ormlite.jdbc.JdbcConnectionSource

public class MysqlDatabaseTypeTest extends BaseJdbcDatabaseTypeTest {

  @Override
  protected void setDatabaseParams() throws SQLException {
    databaseUrl = "jdbc:mysql:ormlite";
    connectionSource = new JdbcConnectionSource(DEFAULT_DATABASE_URL);
    databaseType = new MysqlDatabaseType();
  }
View Full Code Here

Examples of com.j256.ormlite.jdbc.JdbcConnectionSource

    // turn our static method into an instance of Main
    new ForeignMain().doMain(args);
  }

  private void doMain(String[] args) throws Exception {
    JdbcConnectionSource connectionSource = null;
    try {
      // create our data source
      connectionSource = new JdbcConnectionSource(DATABASE_URL);
      // setup our database and DAOs
      setupDatabase(connectionSource);
      // read and write some data
      readWriteData();
      System.out.println("\n\nIt seems to have worked\n\n");
    } finally {
      // destroy the data source which should close underlying connections
      if (connectionSource != null) {
        connectionSource.close();
      }
    }
  }
View Full Code Here

Examples of com.j256.ormlite.jdbc.JdbcConnectionSource

public class SqlServerDatabaseTypeTest extends BaseJdbcDatabaseTypeTest {

  @Override
  protected void setDatabaseParams() throws SQLException {
    databaseUrl = "jdbc:sqlserver:db";
    connectionSource = new JdbcConnectionSource(DEFAULT_DATABASE_URL);
    databaseType = new SqlServerDatabaseType();
  }
View Full Code Here

Examples of com.j256.ormlite.jdbc.JdbcConnectionSource

public class SqliteDatabaseTypeTest extends BaseJdbcDatabaseTypeTest {

  @Override
  protected void setDatabaseParams() throws SQLException {
    databaseUrl = "jdbc:sqlite:";
    connectionSource = new JdbcConnectionSource(DEFAULT_DATABASE_URL);
    databaseType = new SqliteDatabaseType();
  }
View Full Code Here

Examples of com.j256.ormlite.jdbc.JdbcConnectionSource

    // turn our static method into an instance of Main
    new FieldConfigMain().doMain(args);
  }

  private void doMain(String[] args) throws Exception {
    JdbcConnectionSource connectionSource = null;
    try {
      // create our data-source for the database
      connectionSource = new JdbcConnectionSource(DATABASE_URL);
      // setup our database and DAOs
      setupDatabase(connectionSource);
      // read and write some data
      readWriteData();
      System.out.println("\n\nIt seems to have worked\n\n");
    } finally {
      // destroy the data source which should close underlying connections
      if (connectionSource != null) {
        connectionSource.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.