import java.sql.*;

public class d638{
	public static void main(String[] args){

		try {

			Connection conn = null;
			if ((args.length > 0) && args[0].equalsIgnoreCase("client")) {
				Class.forName("org.apache.derby.jdbc.ClientDriver").newInstance();
				conn = DriverManager.getConnection("jdbc:derby://localhost:1528/testdb;create=true","testusr","testpwd");
			}
			else {
				Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
				conn = DriverManager.getConnection("jdbc:derby:testdb;create=true;user=testusr;password=testpwd");
			}

			conn.setAutoCommit(false);
			conn.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
			try{
				conn.close();
				System.out.println("***** Test Passed");
			}catch(SQLException se){
				System.out.println("***** Test failed - Got exception when closing the connection");
				se.printStackTrace();
			}
		}catch(Exception e){
			System.out.println("Unexpected exception");
			e.printStackTrace();
		}

	}
}