public static PreparedStatement createScrollablePreparedStatement(Connection con, String sql)
            throws SQLException {
        if (isScrollResultsSupported()) {
            return con.prepareStatement(sql, ResultSet.TYPE_SCROLL_INSENSITIVE,
                    ResultSet.CONCUR_READ_ONLY);
        }
        else {
            return con.prepareStatement(sql);
        }
    }
Creates a scroll insensitive PreparedStatement if the JDBC driver supports it, or a normal
PreparedStatement otherwise.

@param con the database connection.
@param sql the SQL to create the PreparedStatement with.
@return a PreparedStatement
@throws java.sql.SQLException if an error occurs.
xmppserver/src/main/java/org/jivesoftware/database/DbConnectionManager.java