FileDocCategorySizeDatePackage
TXInfo.javaAPI DocExample1050Sat Oct 26 09:53:38 BST 2002None

TXInfo

public class TXInfo extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] a)

	Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
	Connection con = DriverManager.getConnection(
		"jdbc:odbc:MusicVideo");
	int tx = con.getMetaData().getDefaultTransactionIsolation();
	String txtxt=null;
	switch(tx) {
		case Connection.TRANSACTION_NONE :
			txtxt = "TRANSACTION_NONE"; break;
		case Connection.TRANSACTION_READ_COMMITTED :
			txtxt = "TRANSACTION_READ_COMMITTED"; break;
		case Connection.TRANSACTION_READ_UNCOMMITTED :
			txtxt = "TRANSACTION_READ_UNCOMMITTED"; break;
		case Connection.TRANSACTION_REPEATABLE_READ :
			txtxt = "TRANSACTION_REPEATABLE_READ"; break;
        case Connection.TRANSACTION_SERIALIZABLE :
			txtxt = "TRANSACTION_SERIALIZABLE"; break;
		default:
			txtxt = "UNKNOWN!!";
	}
	System.out.println(txtxt);
	con.setTransactionIsolation(tx);
	System.out.println("Done");
	con.setTransactionIsolation(Connection.TRANSACTION_REPEATABLE_READ);
	System.out.println("TX is now " + con.getTransactionIsolation());