Java Code Examples for org.hibernate.dialect.Dialect.getQuerySequencesString()

The following are Jave code examples for showing how to use getQuerySequencesString() of the org.hibernate.dialect.Dialect class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: lams   File: DatabaseMetadata.java   Source Code and License Vote up 6 votes
private void initSequences(Connection connection, Dialect dialect) throws SQLException {
	if ( dialect.supportsSequences() ) {
		String sql = dialect.getQuerySequencesString();
		if (sql!=null) {

			Statement statement = null;
			ResultSet rs = null;
			try {
				statement = connection.createStatement();
				rs = statement.executeQuery(sql);

				while ( rs.next() ) {
					sequences.add( StringHelper.toLowerCase(rs.getString(1)).trim() );
				}
			}
			finally {
				if ( rs != null ) {
					rs.close();
				}
				if ( statement != null ) {
					statement.close();
				}
			}
		}
	}
}