package jp.co.nec.JTC;import java.sql.*;
import java.util.*;
import java.io.*;
public class JTCDBConnectionF implements Serializable{
protected Connection con = null;
public JTCDBConnectionF() { }
public void dbOpen() throws java.lang.Exception{
if (con == null || con.isClosed()) {
String url = "jdbc:oracle:oci8:@apsv";
String user = "scott";
String pass = "tiger";

Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();

con = DriverManager.getConnection(url,user,pass);

con.setTransactionIsolation( con.TRANSACTION_READ_COMMITTED );
con.setAutoCommit(false); System.out.println("DB OPEN");
} else {
System.out.println("OPENED DB");
}
}
public JTCerrorF dbClose() {
try {
if (con != null && !con.isClosed()) {

con.rollback();
con.close();
System.out.println("DB CLOSE");
} else {
System.out.println("CLOSED DB");
}
}
catch (SQLException se) {
// return new JTCerrorF(se.getErrorCode(),se);
return new JTCerrorF("PD05",se);        //DB CLOSE
}
finally {
con = null;
}
return (JTCerrorF)null;
}
}