oracle connection
2011-01-03 23:11:34

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();

}

}

}

▼ more
mysql connecter
2011-01-03 23:08:14

zz

▼ more
2010-12-30 17:09:16

-Xms128m -Xmx512 만 지켜주면 에러가 나지 않을 프로그램.

▼ more
이순서로
2010-12-30 14:32:10

bike-iptime

bike-iptime1

bike-iptime2

bike-iptime3

bike-dlink

tags : ap-order

▼ more