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

The following examples show how to use org.mybatis.guice.datasource.helper.JdbcHelper. 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
Source File: PostgreSQLAuthenticationProviderModule.java    From guacamole-client with Apache License 2.0 5 votes vote down vote up
@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
Source File: MySQLAuthenticationProviderModule.java    From guacamole-client with Apache License 2.0 5 votes vote down vote up
@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
Source File: SQLServerAuthenticationProviderModule.java    From guacamole-client with Apache License 2.0 5 votes vote down vote up
@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
Source File: PostgreSQLAuthenticationProviderModule.java    From guacamole-client with Apache License 2.0 5 votes vote down vote up
@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
Source File: MySQLAuthenticationProviderModule.java    From guacamole-client with Apache License 2.0 5 votes vote down vote up
@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
Source File: SQLServerAuthenticationProviderModule.java    From guacamole-client with Apache License 2.0 5 votes vote down vote up
@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 File: DataSourceConfig.java    From nano-framework with Apache License 2.0 4 votes vote down vote up
public JdbcHelper getHelper() {
    return helper;
}
 
Example #8
Source File: DataSourceConfig.java    From nano-framework with Apache License 2.0 4 votes vote down vote up
public void setHelper(final JdbcHelper helper) {
    this.helper = helper;
}