import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import com.sephiroce.model.database.SP_DB_Connection;
public class Driver {
public static void main(String[] args){
Connection conn=null;
Statement stmt=null;
ResultSet rs = null;
Connection con=null;
Statement stmt2 =null;
try {
conn = SP_DB_Connection.getConnection();
stmt = conn.createStatement();
rs=stmt.executeQuery("select * from board");
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe", "sephiroce", "lkm0823");
System.out.println("Connected to the database");
stmt2 = con.prepareStatement("insert into board(title, titlesize,contents,contentssize, currenttime,filepath,bgcolor,positingstate, positingaccess, statusid, categoryid) values()");
while(rs.next()){
System.out.println(rs.getString(1));
}
System.out.println("Disconnected from database");
} catch (Exception e) {
System.out.println("====================================================== connection error======================================================");
e.printStackTrace();
System.out.println(e.toString());
System.out.println("====================================================== connection error======================================================");
}
SP_DB_Connection.disConnection(conn, null, rs);
try {
con.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}