Hibernate ORM JdbcServices - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM JdbcServices class.

This code example shows how to use the following methods: getConnectionProvider, getSqlStatementLogger
     
    private Statement stmt;
 
    public DbOpenHelper(ServiceRegistry serviceRegistry) throws HibernateException {
        final JdbcServices jdbcServices = serviceRegistry.getService(JdbcServices.class);
        connectionHelper = new SuppliedConnectionProviderConnectionHelper(jdbcServices.getConnectionProvider());
 
        sqlStatementLogger = jdbcServices.getSqlStatementLogger();
        formatter = (sqlStatementLogger.isFormat() ? FormatStyle.DDL : FormatStyle.NONE).getFormatter();
    } 
 
    public void open() { 
        log.info("Opening database and executing incremental updates"); 
 
        Connection connection = null;
        Writer outputFileWriter = null;
 
        exceptions.clear();
 
        try { 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getConnectionProvider, getDialect, getSqlStatementLogger
 
	public SchemaUpdate(ServiceRegistry serviceRegistry, Configuration cfg) throws HibernateException { 
		this.configuration = cfg; 
 
		final JdbcServices jdbcServices = serviceRegistry.getService( JdbcServices.class ); 
		this.dialect = jdbcServices.getDialect(); 
		this.connectionHelper = new SuppliedConnectionProviderConnectionHelper( jdbcServices.getConnectionProvider() ); 
 
		this.sqlExceptionHelper = new SqlExceptionHelper(); 
		this.sqlStatementLogger = jdbcServices.getSqlStatementLogger(); 
		this.formatter = ( sqlStatementLogger.isFormat() ? FormatStyle.DDL : FormatStyle.NONE ).getFormatter(); 
	} 
 
	private static StandardServiceRegistryImpl createServiceRegistry(Properties properties) { 
		Environment.verifyProperties( properties ); 
		ConfigurationHelper.resolvePlaceHolders( properties ); 
		return (StandardServiceRegistryImpl) new ServiceRegistryBuilder().applySettings( properties ).buildServiceRegistry(); 
	} 
 
	public static void main(String[] args) { 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getConnectionProvider, getDialect
	} 
 
	public SchemaValidator(ServiceRegistry serviceRegistry, Configuration cfg ) throws HibernateException { 
		this.configuration = cfg; 
		final JdbcServices jdbcServices = serviceRegistry.getService( JdbcServices.class ); 
		this.dialect = jdbcServices.getDialect(); 
		this.connectionHelper = new SuppliedConnectionProviderConnectionHelper( jdbcServices.getConnectionProvider() ); 
	} 
 
	private static StandardServiceRegistryImpl createServiceRegistry(Properties properties) { 
		Environment.verifyProperties( properties ); 
		ConfigurationHelper.resolvePlaceHolders( properties ); 
		return (StandardServiceRegistryImpl) new ServiceRegistryBuilder().applySettings( properties ).buildServiceRegistry(); 
	} 
 
	public static void main(String[] args) { 
		try { 
			Configuration cfg = new Configuration(); 
 
			String propFile = null; 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getSqlStatementLogger
				.getServiceRegistry() 
				.getService( JdbcServices.class ) 
				.getSqlStatementLogger(); 
		return session.getTransactionCoordinator().getTransaction().createIsolationDelegate().delegateWork( 
				new AbstractReturningWork<IntegralDataTypeHolder>() { 
					@Override 
					public IntegralDataTypeHolder execute(Connection connection) throws SQLException { 
						IntegralDataTypeHolder value = buildHolder(); 
						int rows; 
						do { 
							// The loop ensures atomicity of the 
							// select + update even for no transaction 
							// or read committed isolation level 
 
							statementLogger.logStatement( query, FormatStyle.BASIC.getFormatter() ); 
							PreparedStatement qps = connection.prepareStatement( query ); 
							try { 
								ResultSet rs = qps.executeQuery(); 
								if ( !rs.next() ) { 
									String err = "could not read a hi value - you need to populate the table: " + tableName; 
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getDialect
		} 
		return generatorClass; 
	} 
 
	@Override 
	public void injectServices(ServiceRegistryImplementor serviceRegistry) { 
		this.dialect = serviceRegistry.getService( JdbcServices.class ).getDialect(); 
	} 
} 
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
See Code Examples for Hibernate ORM JdbcServices Methods: