Java Code Examples for org.mybatis.guice.datasource.helper.JdbcHelper

The following examples show how to use org.mybatis.guice.datasource.helper.JdbcHelper. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Override
public void configure(Binder binder) {

    // Bind PostgreSQL-specific properties
    JdbcHelper.PostgreSQL.configure(binder);
    
    // Bind MyBatis properties
    Names.bindProperties(binder, myBatisProperties);

    // Bind JDBC driver properties
    binder.bind(Properties.class)
        .annotatedWith(Names.named("JDBC.driverProperties"))
        .toInstance(driverProperties);

}
 
Example 2
@Override
public void configure(Binder binder) {

    // Check which MySQL-compatible driver is in use
    switch(mysqlDriver) {
        
        // Bind MySQL-specific properties
        case MYSQL:
            JdbcHelper.MySQL.configure(binder);
            break;
            
        // Bind MariaDB-specific properties
        case MARIADB:
            JdbcHelper.MariaDB.configure(binder);
            break;
            
        default:
            throw new UnsupportedOperationException(
                "A driver has been specified that is not supported by this module."
            );
    }

    // Bind MyBatis properties
    Names.bindProperties(binder, myBatisProperties);

    // Bind JDBC driver properties
    binder.bind(Properties.class)
        .annotatedWith(Names.named("JDBC.driverProperties"))
        .toInstance(driverProperties);

}
 
Example 3
@Override
public void configure(Binder binder) {

    // Bind SQLServer-specific properties with the configured driver.
    switch(sqlServerDriver) {
        case JTDS:
            JdbcHelper.SQL_Server_jTDS.configure(binder);
            break;

        case DATA_DIRECT:
            JdbcHelper.SQL_Server_DataDirect.configure(binder);
            break;

        case MICROSOFT_LEGACY:
            JdbcHelper.SQL_Server_MS_Driver.configure(binder);
            break;

        case MICROSOFT_2005:
            JdbcHelper.SQL_Server_2005_MS_Driver.configure(binder);
            break;

        default:
            throw new UnsupportedOperationException(
                "A driver has been specified that is not supported by this module."
            );
    }
    
    // Bind MyBatis properties
    Names.bindProperties(binder, myBatisProperties);

    // Bind JDBC driver properties
    binder.bind(Properties.class)
        .annotatedWith(Names.named("JDBC.driverProperties"))
        .toInstance(driverProperties);

}
 
Example 4
@Override
public void configure(Binder binder) {

    // Bind PostgreSQL-specific properties
    JdbcHelper.PostgreSQL.configure(binder);
    
    // Bind MyBatis properties
    Names.bindProperties(binder, myBatisProperties);

    // Bind JDBC driver properties
    binder.bind(Properties.class)
        .annotatedWith(Names.named("JDBC.driverProperties"))
        .toInstance(driverProperties);

}
 
Example 5
@Override
public void configure(Binder binder) {

    // Check which MySQL-compatible driver is in use
    switch(mysqlDriver) {
        
        // Bind MySQL-specific properties
        case MYSQL:
            JdbcHelper.MySQL.configure(binder);
            break;
            
        // Bind MariaDB-specific properties
        case MARIADB:
            JdbcHelper.MariaDB.configure(binder);
            break;
            
        default:
            throw new UnsupportedOperationException(
                "A driver has been specified that is not supported by this module."
            );
    }

    // Bind MyBatis properties
    Names.bindProperties(binder, myBatisProperties);

    // Bind JDBC driver properties
    binder.bind(Properties.class)
        .annotatedWith(Names.named("JDBC.driverProperties"))
        .toInstance(driverProperties);

}
 
Example 6
@Override
public void configure(Binder binder) {

    // Bind SQLServer-specific properties with the configured driver.
    switch(sqlServerDriver) {
        case JTDS:
            JdbcHelper.SQL_Server_jTDS.configure(binder);
            break;

        case DATA_DIRECT:
            JdbcHelper.SQL_Server_DataDirect.configure(binder);
            break;

        case MICROSOFT_LEGACY:
            JdbcHelper.SQL_Server_MS_Driver.configure(binder);
            break;

        case MICROSOFT_2005:
            JdbcHelper.SQL_Server_2005_MS_Driver.configure(binder);
            break;

        default:
            throw new UnsupportedOperationException(
                "A driver has been specified that is not supported by this module."
            );
    }
    
    // Bind MyBatis properties
    Names.bindProperties(binder, myBatisProperties);

    // Bind JDBC driver properties
    binder.bind(Properties.class)
        .annotatedWith(Names.named("JDBC.driverProperties"))
        .toInstance(driverProperties);

}
 
Example 7
Source Project: nano-framework   Source File: DataSourceConfig.java    License: Apache License 2.0 4 votes vote down vote up
public JdbcHelper getHelper() {
    return helper;
}
 
Example 8
Source Project: nano-framework   Source File: DataSourceConfig.java    License: Apache License 2.0 4 votes vote down vote up
public void setHelper(final JdbcHelper helper) {
    this.helper = helper;
}