
package com.mr81.biz.board.impl;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;


public class JDBCunit {
	
	private static Connection conn =null;
	
	public JDBCunit() {
		// TODO Auto-generated constructor stub
	}
	
	
	public static Connection getConnection(){
		
		
		
	
		
		try {
			Class.forName("oracle.jdbc.driver.OracleDriver");
			conn=DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:xe","hgj0307","0307"); 
			
		
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
		
		
		return conn;
		
	}

public static void close(PreparedStatement stmt, Connection conn){
	
	try{
		
		if(stmt!=null){
			stmt.close();
		}
		if(conn!=null){
			conn.close();
		}
		
	}catch (Exception e) {
		// TODO: handle exception
	e.printStackTrace();
	}
	
}


public static void close(PreparedStatement stmt, Connection conn, ResultSet set){
	
	try{
		if(set!=null){
			set.close();
		}
		if(stmt!=null){
			stmt.close();
		}
		if(conn!=null){
			conn.close();
		}
		
	}catch (Exception e) {
		// TODO: handle exception
		e.printStackTrace();
	}
	
}


}


{'avg_line_length': 14.011904761904763, 'max_line_length': 93, 'alphanum_fraction': 0.6448598130841121, 'licenses': ['BSD-2-Clause'], 'repository_name': 'mr81-kobe/springQuickstart2', 'path': 'BoardService/src/main/java/com/mr81/biz/board/impl/JDBCunit.java', 'size': 1177, 'lang': 'Java'}