All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.skife.jdbi.v2.TransactionIsolationLevel Maven / Gradle / Ivy

Go to download

jDBI is designed to provide convenient tabular data access in Java(tm). It uses the Java collections framework for query results, provides a convenient means of externalizing sql statements, and provides named parameter support for any database being used.

There is a newer version: 2.78
Show newest version
package org.skife.jdbi.v2;

import java.sql.Connection;

public enum TransactionIsolationLevel
{
    READ_UNCOMMITTED(Connection.TRANSACTION_READ_UNCOMMITTED),
    READ_COMMITTED(Connection.TRANSACTION_READ_COMMITTED),
    REPEATABLE_READ(Connection.TRANSACTION_REPEATABLE_READ),
    NONE(Connection.TRANSACTION_NONE),
    SERIALIZABLE(Connection.TRANSACTION_SERIALIZABLE),
    INVALID_LEVEL(Integer.MIN_VALUE);

    private final int value;

    TransactionIsolationLevel(int value)
    {
        this.value = value;
    }

    public int intValue()
    {
        return this.value;
    }

    public static TransactionIsolationLevel valueOf(int val) {
        switch (val) {
            case Connection.TRANSACTION_READ_UNCOMMITTED: return READ_UNCOMMITTED;
            case Connection.TRANSACTION_READ_COMMITTED: return READ_COMMITTED;
            case Connection.TRANSACTION_NONE: return NONE;
            case Connection.TRANSACTION_REPEATABLE_READ: return REPEATABLE_READ;
            case Connection.TRANSACTION_SERIALIZABLE: return SERIALIZABLE;
            default: return INVALID_LEVEL;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy