DCL 3.7.4
Loading...
Searching...
No Matches
OciModuleMain.cpp File Reference
#include <dcl/Config.h>
#include <oci.h>
#include <locale.h>
#include <dcl/_stdlib.h>
#include <dcl/Object.h>
#include <dcl/SQLCore.h>
#include "OciConnection.h"

Go to the source code of this file.

Macros

#define __TRACE_THIS   0
#define __DCL_TRACE0_N(fmt)
#define __DCL_TRACE1_N(fmt, arg)
#define __DCL_TRACE2_N(fmt, arg1, arg2)
#define __DCL_TRACE3_N(fmt, arg1, arg2, arg3)
#define __DCL_TRACE4_N(fmt, arg1, arg2, arg3, arg4)

Functions

SQL::ConnectionCreateConnectionInstance ()
bool ModuleInitialize ()
bool ModuleCleanup ()

Variables

DCL_DSO_EXPORT SQL::DRIVER_MODULE DCL_DSO_ENTRY_POINT

Macro Definition Documentation

◆ __DCL_TRACE0_N

#define __DCL_TRACE0_N ( fmt)

Definition at line 29 of file OciModuleMain.cpp.

◆ __DCL_TRACE1_N

#define __DCL_TRACE1_N ( fmt,
arg )

Definition at line 30 of file OciModuleMain.cpp.

◆ __DCL_TRACE2_N

#define __DCL_TRACE2_N ( fmt,
arg1,
arg2 )

Definition at line 31 of file OciModuleMain.cpp.

◆ __DCL_TRACE3_N

#define __DCL_TRACE3_N ( fmt,
arg1,
arg2,
arg3 )

Definition at line 32 of file OciModuleMain.cpp.

◆ __DCL_TRACE4_N

#define __DCL_TRACE4_N ( fmt,
arg1,
arg2,
arg3,
arg4 )

Definition at line 33 of file OciModuleMain.cpp.

◆ __TRACE_THIS

#define __TRACE_THIS   0

Definition at line 21 of file OciModuleMain.cpp.

Function Documentation

◆ CreateConnectionInstance()

SQL::Connection * CreateConnectionInstance ( )

Definition at line 65 of file OciModuleMain.cpp.

66{
67 return (new OciConnection(_serverTitle));
68}

◆ ModuleCleanup()

bool ModuleCleanup ( )

Definition at line 95 of file OciModuleMain.cpp.

96{
97 sword status = ::OCITerminate(OCI_DEFAULT);
98/*
99 if (status != OCI_SUCCESS)
100 {
101 setErrorMessage(status, NULL, __LINE__);
102 return false;
103 }
104*/
105 if (status != OCI_SUCCESS)
106 return false;
107
108 return true;
109}

◆ ModuleInitialize()

bool ModuleInitialize ( )

Definition at line 70 of file OciModuleMain.cpp.

71{
72 // https://docs.oracle.com/cd/B13789_01/server.101/b10749/ch7progr.htm#1006615
73 // When the NLS_LANG Character Set is UTF8 or AL32UTF8 in OCI
74
75 const char* langUTF8 = "AMERICAN_AMERICA.UTF8";
76 char* lang = getenv("LANG");
77 if (!lang) {
78 // current locale
79 lang = setlocale(LC_CTYPE, NULL);
80 }
81#if 0
82 // 2025-12-03 instantclient-basiclite- 기준, 항상 영문 메시지만 표시한다.
83 if (lang) {
84 ByteString lang_ = ByteString(lang);
85 ByteString lower = lang_.toLowerCase();
86 if (lower.contains("ko") || lower.contains("kr")) {
87 langUTF8 = "KOREAN_KOREA.UTF8";
88 }
89 }
90#endif
91 __DCL_TRACE1_N(L"setenv NLS_LANG=[%hs]\n", langUTF8);
92 return setenv("NLS_LANG", langUTF8, 1) == 0;
93}
#define NULL
Definition Config.h:312
#define __DCL_TRACE1_N(fmt, arg)

Variable Documentation

◆ DCL_DSO_ENTRY_POINT

DCL_DSO_EXPORT SQL::DRIVER_MODULE DCL_DSO_ENTRY_POINT
Initial value:
=
{
__T("DCL SQL Adapter for Oracle Database Server"),
_serverTitle,
}
#define DCL_BUILD_FLAG
Definition Config.h:362
#define DCL_SQL_DRIVER_MODULE
Definition Config.h:353
bool ModuleInitialize()
bool ModuleCleanup()
SQL::Connection * CreateConnectionInstance()
#define __T(str)
Definition Object.h:60
#define DCL_SQL_VERSION
#define __BUILD_TIMESTAMP__
#define DCL_VERSION
#define DCL_SQL_VERSION_STRING

Definition at line 114 of file OciModuleMain.cpp.

115{
116 // DCL common members
117 sizeof(SQL::DRIVER_MODULE), // structure size
121 DCL_SQL_DRIVER_MODULE, // module type
122 __T("DCL SQL Adapter for Oracle Database Server"),
123
124 // private members
126 _serverTitle,
131};