jdbc database transaction isolation level view

2011-02-12  来源:本站原创  分类:Database  人气:84 

jdbc database transaction isolation level view

Database transaction 2009-07-04 15:22:53 read 111 comments 0 Word Count: Subscribe

public static void main (String [] args) {
String driverClass = "net.sourceforge.jtds.jdbc.Driver";
/ / DriverClass = "com.mysql.jdbc.Driver";
driverClass = "oracle.jdbc.driver.OracleDriver";

String url = "jdbc: jtds: sqlserver: / / localhost: 1433; DatabaseName = zypsb";
/ / Url =
/ / "Jdbc: mysql: / / localhost: 3306/mysql? UseUnicode = true & characterEncoding = gb2312";
url = "jdbc: oracle: thin: @ localhost: 1521: SUNJUN";
try {
Class.forName (driverClass);
Connection con = DriverManager.getConnection (url, "system",
"Sunjun");
DatabaseMetaData dbmt = con.getMetaData ();
System.out.println (dbmt.supportsTransactions ());
/ / 0
if (dbmt
. SupportsTransactionIsolationLevel (Connection.TRANSACTION_NONE))
System.out.println ("TRANSACTION_NONE");
/ / 1
if (dbmt
. SupportsTransactionIsolationLevel (Connection.TRANSACTION_READ_UNCOMMITTED))
System.out.println ("TRANSACTION_READ_UNCOMMITTED");
/ / 2
if (dbmt
. SupportsTransactionIsolationLevel (Connection.TRANSACTION_READ_COMMITTED))
System.out.println ("TRANSACTION_READ_COMMITTED");
/ / 4
if (dbmt
. SupportsTransactionIsolationLevel (Connection.TRANSACTION_REPEATABLE_READ))
System.out.println ("TRANSACTION_REPEATABLE_READ");
/ / 8
if (dbmt
. SupportsTransactionIsolationLevel (Connection.TRANSACTION_SERIALIZABLE))
System.out.println ("TRANSACTION_SERIALIZABLE");
System.out.println (dbmt.getDefaultTransactionIsolation ());
} Catch (Exception e) {
e.printStackTrace ();
}
}

-------------------------------------------------- -------------------------------------------------
sqlserver 2000
true
TRANSACTION_READ_UNCOMMITTED 1
TRANSACTION_READ_COMMITTED 2
TRANSACTION_REPEATABLE_READ 4
TRANSACTION_SERIALIZABLE 8
2

-------------------------------------------------- -------------------------------------------------
mysql 5.0
true
TRANSACTION_READ_UNCOMMITTED 1
TRANSACTION_READ_COMMITTED 2
TRANSACTION_REPEATABLE_READ 4
TRANSACTION_SERIALIZABLE 8
2

-------------------------------------------------- -------------------------------------------------
oracle 10g
true
TRANSACTION_READ_COMMITTED 2
TRANSACTION_SERIALIZABLE 8

2

相关文章
  • jdbc database transaction isolation level view 2011-02-12

    jdbc database transaction isolation level view Database transaction 2009-07-04 15:22:53 read 111 comments 0 Word Count: Subscribe public static void main (String [] args) { String driverClass = "net.sourceforge.jtds.jdbc.Driver"; / / DriverClass

  • Offers four database transaction isolation level 2011-01-14

    sql server locking mechanism Locks of the two classification methods. (1) From the perspective of the database system is divided into the following three types of locks: Exclusive lock (Exclusive Lock) Exclusive locks lock the resources operate only

  • Database transaction isolation level provides four 2011-01-14

    sql server locking mechanism There are two classifications lock. (1) from a database point of view of the lock system is divided into the following three types: Exclusive lock (Exclusive Lock) Exclusive locks only lock the resources operate the progr

  • Database transaction isolation level 2010-03-02

    Database transaction isolation level ANSI / ISO SQL92 standard defines a number of database operations in the isolation level: l uncommitted read (read uncommitted) l submit time (read committed) l repeat time (repeatable read) l sequence of (seriali

  • Database transaction isolation level and lock 2010-11-12

    First, the basic characteristics of affairs 4 Atomic (atomic): Services include the operation was seen as a logical unit, the logic unit operations either all succeed or all fail. Consistency (consistency): Only valid data can be written to the datab

  • About the database transaction. Isolation level. Understanding and finishing locks 2011-08-01

    Transaction (Transaction) Database transaction is the basic unit of database concurrency control, a collection of operations sequence. Either have implemented or not implemented, is an indivisible whole. Such as bank transfers money from one account

  • Transaction isolation level (reproduced) 2011-10-01

    Original link: http://wlh269.iteye.com/blog/332577 Database transaction isolation level offers four different isolation levels with different types of locks opened to achieve. In the four isolation levels, Serializable the highest level, Read Uncommi

  • JDBC transaction isolation level 2010-07-10

    If the DBMS supports transaction processing, it must have some way to manage both the transaction and operation of a database of possible conflicts. Users can specify the transaction isolation level to specify the DBMS should spend much effort to res

  • Transaction isolation level 2010-03-25

    Affairs of the four properties: atomicity (atomicity), consistency (consistency), isolation (isolation) and persistence (durability). 1. Atomicity (Atomic) The most important principle, the principle is the most easy to understand. Management was all

  • Transaction isolation level (change) 2010-03-15

    Affairs of the four properties: atomicity (atomicity), consistency (consistency), isolation (isolation) and persistence (durability). 1. Atomicity (Atomic) The most important principle, the principle is the most easy to understand. Management was all

  • [Change] transaction isolation level 2010-04-08

    Affairs of the four properties: atomicity (atomicity), consistency (consistency), isolation (isolation) and persistence (durability). 1. Atomicity (Atomic) The most important principle, the principle is the most easy to understand. Management was all

  • Stored procedure to set the lock level set transaction isolation level 2011-03-19

    Grammar SET TRANSACTION ISOLATION LEVEL { READ UNCOMMITTED | READ COMMITTED | REPEATABLE READ | SNAPSHOT | SERIALIZABLE } [ ; ] Remarks You can only set an isolation level option, and set the options on that connection will always remain in effect un

  • MySQL transaction isolation level 2010-06-22

    SQL standard defines four categories isolation level, including a number of specific rules to limit what changes inside and outside the transaction is visible, which is not visible. Low-level isolation level generally support more concurrent processi

  • Database transaction isolation levels and locking mechanisms to achieve 2010-06-24

    A good article, ref: http://www.fuancn.cn/html/ServerSettings/Database/SQL/20096461.html ACID, refers to the atomic database (Atomicity), consistency (Consistency), isolation (Isolation), durable (Durability). A Support Services ( ACID, refers to the

  • mysql transaction isolation level, and reading problems (dirty read, unrepeatable read, phantom read) 2010-09-04

    1. Service in a number of problem read: dirty read, unrepeatable read, phantom read Dirty read (dirty read) transaction records T1 line updated content, but did not submit the changes made. Transaction T2 reads the updated row, and then perform a rol

  • MySQL transaction isolation level Xiangjie 2010-09-24

    SQL standard defines four categories isolation level, including a number of specific rules to limit what changes inside and outside the transaction is visible, which is not visible. Low-level isolation level generally support more concurrent processi

  • MySQl transaction isolation level (command and simple to understand) 2010-10-09

    1. View the current session isolation level select @ @ tx_isolation; 2. View the system the current isolation level select @ @ global.tx_isolation; 3. Set the current session isolation level set session transaction isolatin level repeatable read; 4.

  • On the Spring transaction isolation level 2010-11-07

    A, Propagation: key property to determine to which agency should be ways to increase transaction behavior. This property is the most important part of the communication behavior. The following options are available: PROPAGATION_REQUIRED - support the

  • spring transaction isolation level behavior and the spread of 2011-01-09

    spring transaction propagation behavior is frequently asked question in interviews, to transaction propagation behavior and isolation level skilled master, in the actual development process, especially in the Complicated, update the data volume, a re

  • Detailed MySQL transaction isolation level 2010-09-24

    The SQL standard defines four types of isolation level, including a number of specific rules that limit what changes inside and outside the transaction is visible, which is not visible. Low-level isolation level generally support higher concurrency,