000142682 kA74Q0000004NSDSA2
Championship | How to configure ODBC data sources and test the connection to a database on a Unix or Linux platform? |
Environment | Production: Connect/Connect64 for ODBC, Progress DataDirect for ODBC Version: All supported versions Bone: All supported Unix and Linux platforms Database: All supported databases Awarding: All ODBC applications |
Question/Problem Clarification | How to configure ODBC data sources and test the connectedness to a database on a Unix or Linux platform? |
Resolution | 1. Run the shell script shipped with the product to set environment variables The product ships with shell scripts that will make necessary changes to the shared library path variables and ready the ODBCINI, ODBCINST environs variables. Manually add the database client specific library to the shell scripts in example a not-wire protocol ODBC driver is used.
There are 2 scripts (odbc.csh and odbc.sh) in the ($ODBC_HOME) directory. For Korn, Borne and equivalent shells, run odbc.sh, for C shell, run odbc.csh instead. example: $ . odbc.sh After running the setup script, issue the env control to cheque that the ($ODBC_HOME)/lib directory has been added to the shared library path.
Below is a list of shared library path variable names on supported the UNIX platforms and Linux: AIX : LIBPATH HP-UX : SHLIB_PATH SOLARIS : LD_LIBRARY_PATH LINUX : LD_LIBRARY_PATH Also check that the ODBCINI and ODBCINST surround variable have been fix. The variables should point to the full path from the root of the odbc.ini / odbcinst.ini (e.1000. ODBCINI=/usr/myhome/odbc.ini or ODBCINST=/usr/myhome/odbcinst.ini). The shell script will use the default odbc.ini / odbcinst.ini templates installed in the ($ODBC_HOME) directory. 2. Create and configure an ODBC data source in the odbc.ini - On Linux a graphical ODBC Administrator interface is shipped that tin can exist used to modify the odbc.ini, just like on Windows. Otherwise use a obviously text tool like vi to alter the odbc.ini
- The odbc.ini shipped with the product contains templates for each ODBC driver:
[Oracle Wire Protocol] Driver=/opt/Progress/DataDirect/Connect_for_ODBC_xx/lib/ivoraxx.and so Clarification=DataDirect x.x Oracle Wire Protocol AlternateServers= ApplicationUsingThreads=1 ... - Make a copy of such a template and alter the proper name betwixt the brackets: e.g.
[MyOracleDSN] Driver=/opt/Progress/DataDirect/Connect_for_ODBC_xx/lib/ivoraxx.so Description=DataDirect ten.10 Oracle Wire Protocol AlternateServers= ApplicationUsingThreads=one ... Practice not put the ODBC commuter specific information source options in the [ODBC] section. - Annals this information source name in the section [ODBC Data Sources]
[ODBC Data Sources] .. MyOracleDSN=DataDirect 10.x Oracle Wire Protocol .. - Enter the values for the specified options in the newly created ODBC information source. Consult the "Connection Option Descriptions" driver specific section in the DataDirect Connect® Series for ODBC User'south Guide. For connection options not listed in the ODBC information source, the default values will be used.
Certain parameters in the odbc.ini template have brackets in them such as the example below:
Database=<database_name> Do not leave the '<>' brackets in place, exist sure to either populate these fields with values or remove the brackets so information technology looks similar ane of the 2 examples below: Database=myDatabase or Database=
The default odbc.ini contains user name (LogonID) and password parameters for some information sources. If you fill in these parameters, y'all will still have to pass them when connecting from your application. For this reason, and for security reasons (text in the odbc.ini file is not encrypted), you should not shop your user name and countersign in your odbc.ini information source. When the awarding needs to utilise file DSN's, add a directory reference like below in the odbc.ini.
[ODBC File DSN] DefaultDSNDir=/myfiledsndir 3. Apply ivtestlib/ddtestlib Verify that the ODBC driver libraries can be loaded by using the ivtestlib or ddtestlib shipped with the product. 32-chip: ($ODBC_HOME)/bin/ivtestlib($ODBC_HOME)/lib/iv<drivername>.so 64-flake: ($ODBC_HOME)/bin/ddtestlib($ODBC_HOME)/lib/dd<drivername>.and then 4. Test the connection with example When the environment variables have been set, the ODBC information source has been created and the to a higher place driver load examination is successful, use the application 'instance' to test the database connection. A compiled version of the awarding is installed in ($ODBC_HOME)/samples/instance/case. The program will prompt for a information source name. Enter the name of the ODBC data source as prepare in the .odbc.ini file. Then enter a user id and password. If the connexion is successful the program will so give a SQL prompt to type SQL commands to the database. To quit: do not enter a SQL control and printing ENTER. |
Last Modified Appointment | 2/5/2020 9:30 PM |
Disclaimer | The origins of the information on this site may be internal or external to Progress Software Corporation ("Progress"). Progress Software Corporation makes all reasonable efforts to verify this information. However, the data provided is for your information merely. Progress Software Corporation makes no explicit or implied claims to the validity of this information. Whatever sample code provided on this site is not supported under any Progress support programme or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire hazard arising out of the use or operation of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or commitment of the code be liable for any damages whatever (including, without limitation, damages for loss of business concern profits, business concern break, loss of business organisation data, or other pecuniary loss) arising out of the apply of or inability to use the sample code, fifty-fifty if Progress has been advised of the possibility of such damages. |
0 Response to "How To Register An Odbc Resource From A Program"
Post a Comment