상세 컨텐츠

본문 제목

Oracle Instant Client이용한 드라이브 설치

DataBase/Oracle

by 탑~! 2011. 8. 17. 19:06

본문


Oracle Client를 이용한 드라이브 설치
오라클 클라이언트를 설치하면 자동으로 오라클 드라이브가 설치된다.
오라클 클라이언트의 tnsnames.ora의 정보를 이용해서 접속

Oracle Instant Client이용한 드라이브 설치
Instant Client Downloads for Microsoft Windows (32-bit)
위치
http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/winsoft.html
버전에 따라 다운로드 해서 사용할 것

포함된 파일들을 프로그램 exe가 있는 위치에 모두 복사할 것
Visual Studio 프로젝트일 경우 Debug나 Release에 복사할 것
tnsnames.ora의 정보를 프로그램에서 직접 입력

string szServerInfo = "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xxx.130.111.122)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL)));User Id=scott;Password=tiger;";
string sql = "select * from mytable";
OracleConnection conn = null;
try
{
conn = new OracleConnection(szServerInfo);
conn.Open();
OracleCommand comm = new OracleCommand(sql, conn);
OracleDataReader rs = comm.ExecuteReader();
while (rs.Read())
{
MessageBox.Show(rs.GetString(1));
}
rs.Close();
}
catch (Exception e2)
{
MessageBox.Show(e2.StackTrace);
}
finally{
conn.Close();
}


출처 : http://blog.naver.com/PostView.nhn?blogId=nerve21i&logNo=100134604460

'DataBase > Oracle' 카테고리의 다른 글

오라클 문자열 관련 함수  (0) 2012.05.15
문자열 수식 계산처리  (0) 2012.05.15
초를 일시분초로 변환  (0) 2012.05.15
Windows7 에 Oracle11g R2 설치하기  (0) 2012.05.11
Oracle Direct Connection String  (0) 2010.10.22

관련글 더보기