Using Perl to Access the Database
3.8.1.2 Testing a Database Connection
Example 3–2 shows a sample Perl script for testing a database connection. Replace the instance name, userid, and password in the connect statement with proper values for the target database. Example 3–2 Sample Perl Script For Testing Connection for Local Seed Database use DBI; print Content-type: textplain\n\n; dbh = DBI-connectdbi:Oracle:instance_name, useridpassword, || die DBI::errstr; stmt = dbh-prepareselect from emp order by empno|| die DBI::errstr; rc = stmt-execute || die DBI::errstr; while empno, name = stmt-fetchrow { print empno name\n; } warn DBI::errstr if DBI::err; die fetch error: . DBI::errstr if DBI::err; stmt-finish || die cant close cursor; dbh-disconnect || die cantt log off Oracle;3.8.1.3 Using SQL NCHAR Data Types
SQL NCHAR data types NCHAR, NVARCHAR2 and NCLOB are reliable Unicode data types. SQL NCHAR data types enable you to store Unicode characters regardless of the database character set. The character set for those data types is specified by the national character set, which is either AL16UTF-16 or UTF8. Example 3–3 shows an example of accessing SQL NCHAR data. Example 3–3 Sample Script to Access SQL NCHAR Data declare to use the constants for character forms use DBD::Oracle qw:ora_forms; connect to the database and get the database handle dbh = DBI-connect ... ; prepare the statement and get the statement handleParts
» Oracle Fusion Middleware Online Documentation Library
» Security: Encryption with Secure Sockets Layer
» Security: Single Sign-On Key Features of Oracle HTTP Server
» Distributed Authoring and Versioning DAV Support
» URL Rewriting and Proxy Server Capabilities
» Oracle Process Manager and Notification Server Oracle Plug-Ins
» PLSQL Server Pages Key Features of Oracle HTTP Server
» Server-Side Includes Key Features of Oracle HTTP Server
» Perl Key Features of Oracle HTTP Server
» Understanding Oracle HTTP Server Directory Structure
» Understanding Configuration Files Oracle HTTP Server Support
» Overview of Oracle HTTP Server Management Accessing Fusion Middleware Control
» mod_certheaders Oracle Fusion Middleware Online Documentation Library
» mod_dms Oracle Fusion Middleware Online Documentation Library
» mod_onsint Oracle Fusion Middleware Online Documentation Library
» mod_oradav Oracle Fusion Middleware Online Documentation Library
» mod_ossl Oracle Fusion Middleware Online Documentation Library
» mod_osso Oracle Fusion Middleware Online Documentation Library
» Using Perl to Access the Database
» Select the mod_perl.conf file from the menu and click Go.
» plsql.conf Configuration Files for mod_plsql
» If necessary, change the user to the Oracle software owner user, typically oracle,
» cache.conf Configuration Files for mod_plsql
» Select Control from the Oracle HTTP Server menu. Select Start Up from the Control menu.
» Using opmnctl to Start Oracle HTTP Server
» Using opmnctl to Stop Oracle HTTP Server
» Select the Control from the Oracle HTTP Server menu.
» Select Restart from the Control menu.
» Using opmnctl to Restart Oracle HTTP Server
» Creating a New Oracle HTTP Server Component
» Using Fusion Middleware Control to Specify Server Properties
» Editing the httpd.conf File to Specify Server Properties
» Using Fusion Middleware Control to Configure a Wallet and SSL
» Select Administration from the Oracle HTTP Server menu.
» Select MIME Configuration from the Administration menu. The MIME
» Configuring the mod_perl Module
» Enter the base URI for the Perl scripts in the Locations field. Just as it is the
» Enter options in the Options field. The PerlOptions directive provides
» If you want to send headers, then click the Send Header check box. The
» Enter the environment in the Environment fiel The PerlSetEnv directive
» Enter the response handler in the Response Handler field. The
» Configuring the mod_wl_ohs Module
» Click Add Row to create a new row.
» Enabling the mod_osso Module Modifying an Oracle HTTP Server Configuration File
» Disabling the Options Method
» Deleting an Oracle HTTP Server Component
» Request Process Model Oracle HTTP Server Processing Model
» Viewing Oracle HTTP Server Performance Metrics
» Understanding Oracle HTTP Server Performance Metrics
» Using Fusion Middleware Control to Set the Request Configuration
» Understanding Process Security Oracle Fusion Middleware Online Documentation Library
» Using Fusion Middleware Control to Create Ports Using Fusion Middleware Control to Edit Ports
» Log Format About Access Logs
» About Error Logs About Log Rotation
» Review the settings. If the settings are correct, click Apply to apply the changes. If
» OraLogMode Oracle Diagnostic Logging Directives
» OraLogDir Oracle Diagnostic Logging Directives
» OraLogSeverity Oracle Diagnostic Logging Directives
» OraLogRotationParams Oracle Diagnostic Logging Directives
» ErrorLog Apache Log Directives
» LogLevel Apache Log Directives
» LogFormat CustomLog Apache Log Directives
» Viewing Oracle HTTP Server Logs
» About Oracle HTTP Server Security
» Classes of Users and Their Privileges Resources Protected
» Using Apache to Authenticate Users Using mod_osso to Authenticate Users
» WebDAV OraDAV Introduction to the mod_oradav Module
» OraDAV Architecture Introduction to the mod_oradav Module
» ORAAllowIndexDetails OraDAV Configuration Parameters
» ORAAltPassword ORACacheDirectory OraDAV Configuration Parameters
» ORACacheMaxResourceSize OraDAV Configuration Parameters
» ORACachePrunePercent OraDAV Configuration Parameters
» ORACacheTotalSize ORAConnect ORAConnectSN OraDAV Configuration Parameters
» ORAContainerName OraDAV Configuration Parameters
» ORAException OraDAV Configuration Parameters
» ORAGetSource OraDAV Configuration Parameters
» ORALockExpirationPad OraDAV Configuration Parameters
» ORAPackageName OraDAV Configuration Parameters
» ORAPassword OraDAV Configuration Parameters
» ORARootPrefix OraDAV Configuration Parameters
» ORAService OraDAV Configuration Parameters
» ORATraceEvents OraDAV Configuration Parameters
» ORATraceLevel OraDAV Configuration Parameters
» WebDAV Security Considerations Globalization Support Considerations with OraDAV
» Right-click the Default Sites folder, and then select the New - Virtual
» In the Virtual Directory Creation Wizard window, enter oproxy for the Alias.
» Click Finish to close the Virtual Directory Creation Wizard.
» Right-click the Default Sites folder, and then select the Properties option from
» In the Default Web Site Properties window, select the ISAPI Filters ta
» Click Add to add a new filter.
» Enter oproxy for the filter name. Then, enter the path or browse to the
» Click OK to close the AddEdit Filter Properties window.
» Click OK to close the Default Web Site Properties window.
» Open the IIS Manager by clicking Start - Programs - Administrative Tools
» Click the Default Web Site icon to open the Default Web Site Home page.
» Double-click the ISAPI Filters icon to open the ISAPI Filters page, and then
» Click the Default Web Site icon in the navigation panel to view all the settings
» Click the Handler Mappings option to set the mappings for the handler for a
» Click the StaticFile option in the Handler Mappings page, and in the Edit
» In the Actions area of the Handler Mappings page, click the Add Script Map
» In the Edit Script Map dialog box: enter for the Request path. Use the
» Click the Request Restrictions button to open the Request Restrictions dialog
» Click Yes on the Add Script Map dialog box.
» In the Filter Name field, enter osso for the filter name.
Show more