Oracle Call Interface Getting Started for Windows Platforms | ![]() Library |
![]() Product |
![]() Contents |
![]() Index |
Project files are often used to assist in building application programs. They guide and control the steps necessary to precompile, compile, and link programs.
MS Visual C/C++ and Borland C/C++ project files help keep executable versions of your programs current when you modify dependent files. These project files are provided with Windows NT/95 sample programs. The MS Visual C/C++ and Borland C/C++ project files:
For more information on the build process, refer to the applicable product documentation for your development environment.
To compile the resulting .C source file, switch to the development environment and build the application. Some compiler options are required while others are optional. All options are case-sensitive and are listed below.
Use the following options when compiling an Oracle database application using Microsoft C:
Refer to the documentation provided with your development environment to ensure that all applicable options are selected.
To debug your application using Microsoft CodeView, use the normal debugging option. For more information, see your Microsoft documentation.
Refer to the documentation provided with your development environment to ensure that all applicable options are selected.
Use the following options when compiling an Oracle database application using Borland C.
To debug your application using Borland Turbo Debugger, use the normal debugging option. For more information, see your Borland documentation.
When you link OCI applications, you use the following types of library files:
Oracle libraries are required for OCI and/or applications that access an Oracle database.
Runtime libraries are created when you install your C compiler. Runtime libraries are required for any C application, including applications that access the Oracle database.
The OCI calls are implemented in DLL files that Oracle provides. To use the DLLs, you must link your application with the import libraries (.LIB files) that correspond to the OCI DLLs. Also, you must make sure that the OCI DLL files are installed on the workstation that is using your OCI application.
Applications linked with DLLs provide the following benefits over static libraries:
Library Type | Library Name | DLL Name |
ORACLE
|
OCIW32.LIB
|
OCIW32.DLL
|
Select the Correct Runtime Library In order to build a Windows NT/95 application, select the appropriate runtime library for the application you are building. See the compiler documentation for your compiler. Also, include the OCIAPR.H header file in your source code. See your compiler's documentation for more information.
To link a Windows NT/95 application, you must use the runtime libraries installed with the C compiler.
Resource File Before linking a Windows NT/95 application, you must build resources such as menus, dialog boxes, cursors, and character strings. You can create resources by using Microsoft's App Studio or Borland's Resource Workshop. For further information, consult your compiler's documentation.
Microsoft Visual C/C++ It is recommended that you include \MSDEV\LIB on the search path if using MSVC 4.x.
Borland Link Options Use the following options to link an Oracle Database application.
To use OCI, include OCI header files in your programs. The files are as follows:
The Programmer's Guide to the ORACLE Call Interfaces documents the cursor data area definition and the logon data area definition.
This program adds new employee records to the personnel database. The program checks the integrity of the database. You can enter as many employee names as you want and perform the SQL commands by selecting the appropriate buttons in the Employee Record box.
The WINOCI program displays a graphical window. Select Connect from the Oracle menu to display the logon dialog box. Type the userid SCOTT, the password TIGER, and the name of the remote Oracle7 Server. Click on OK to connect with the Oracle database.
The following lists the buttons and their definitions available in the programs:
Note Oracle recommends that you use Clear, enter values for the buttons, then use Select to enter the new record.
|
To analyze how an OCI for Windows NT/95 application is built, examine the Microsoft project file by using a text editor to view the steps required to compile, create resources, and link a Windows NT/95 application.
When you link OCI applications, you use the following types of library files:
Oracle libraries are required for OCI and/or applications that access an Oracle database.
Runtime libraries are created when you install your C compiler. Runtime libraries are required for any C application, including applications that access the Oracle database.
The OCI calls are implemented in DLL files that Oracle provides. To use the DLLs, you must link your application with the import libraries (.LIB files) that correspond to the OCI DLLs. Also, you must make sure that the OCI DLL files are installed on the workstation that is using your OCI application.
Applications linked with DLLs provide the following benefits over static libraries:
The required library files are listed in the following tables:
Library Type | Library Name | DLL Name |
ORACLE
|
OCIW16.LIB
|
OCIW16.DLL
|
Library Type | Microsoft Library Name |
Runtime for large model
|
LLIBCAW.LIB, LLIBCEW.LIB, LIBW.LIB
|
Runtime for medium model
|
MLIBCAW.LIB, MLIBCEW.LIB, LIBW.LIB
|
Library Type | BORLAND Library Name |
Runtime for large model
|
CWL.LIB, MATHWL.LIB, IMPORT.LIB
|
Runtime for medium model
|
CWM.LIB, MATHWM.LIB, IMPORT.LIB
|
Select the Correct Runtime Library In order to build a Windows application, select the appropriate runtime library for the application you are building. For example, if you are using the medium model, link with the medium model runtime library. In addition, designate a minimum of 30K of stack space to perform Oracle database operations. Also, include the OCIAPR.H header file in your source code. See your compiler's documentation for more information.
To link a Windows application, you must use the runtime libraries installed with the C compiler.
You must also link with a module definition file, as described in your compiler's documentation. Windows applications that access an Oracle database require no special module statements. The module definition file for the sample Windows application is named WINSAM.DEF.
The following module statements must appear in the file:
The following example presents the contents of a typical module definition file:
Module | Definition |
NAME
|
WINOCI
|
DESCRIPTION
|
Sample OCI application for Windows
|
EXETYPE
|
Windows
|
DATA
|
Preload Movable Discardable
|
CODE
|
Preload Movable Multiple
|
STACKSIZE
|
4096
|
HEAPSIZE
|
30000
|
EXPORTS
|
Before linking a Windows application, you must build resources such as menus, dialog boxes, cursors, and character strings. You can create resources by using Microsoft's App Studio or Borland's Resource Workshop. For further information, consult your compiler's documentation.
The following options can be used to link an Oracle database application using Microsoft C:
The following options can be used to link an Oracle database application using Borland:
To use OCI, include OCI header files in your programs. The files are as follows:
The Programmer's Guide to the ORACLE Call Interfaces documents the cursor data area definition and the logon data area definition.
This program adds new employee records to the personnel database. The program checks the integrity of the database. You can enter as many employee names as you want and perform the SQL commands by selecting the appropriate buttons in the Employee Record box.
The WINOCI program displays a graphical window. Select Connect from the Oracle menu to display the logon dialog box. Type the userid SCOTT, the password TIGER, and the name of the remote Oracle7 Server. Click on OK to connect with the Oracle database.
The following lists the buttons and their definitions available in the programs:
Note Oracle recommends that you use Clear, enter values for the buttons, then use Select to enter the new record.
|
To analyze how an OCI for Windows application is built, examine the Microsoft project file by using a text editor to view the steps required to compile, create resources, and link a Windows application.
![]() ![]() Prev Next |
![]() Copyright © 1996 Oracle Corporation. All Rights Reserved. |
![]() Library |
![]() Product |
![]() Contents |
![]() Index |