TroubleShooting Information Click Connect to gain access to the database using the new sign-on. The

Configuring and Using the Pluggable Data sources 14-19 ■ Metadata information received from the driver. ■ Final query submitted to the database. See Example 14–1 for sample design-time trace output. See Example 14–2 for sample run-time trace output. For more information on the location of the logging.xml file, see Section 24.3.7, Tracing Report Execution Sample trace output Example 14–1 Building a JDBC Query from JDBC Query Dialog Connection handling trace showing final connect string [200347 5:41:38:686] Debug 50103 jdbcpds: handleConnectButtonEvent : start [200347 5:41:38:686] Debug 50103 jdbcpds: handleConnectButtonEvent : subProtocol :sybase-merant [200347 5:41:38:686] Debug 50103 jdbcpds: handleConnectButtonEvent : connection class :oracle.reports.plugin.datasource.jdbcpds.JDBCConnectionHandling [200347 5:41:38:696] Debug 50103 jdbcpds: handleConnectButtonEvent : combine string :jdbc:merant:sybase:server1.us.oracle.com:1300 [200347 5:41:38:696] Debug 50103 jdbcpds: JDBCDataSource : setJDBCQueryType: sybase [200347 5:41:41:350] Debug 50103 jdbcpds: JDBCUIEventHandler : handleConnectEvent : Valid Connection com.oracle.ias.jdbc.sybase.SybaseConnection56fc16 [200347 5:41:41:350] Debug 50103 jdbcpds: JDBCUIEventHandler : handleConnectEvent : END com.oracle.ias.jdbc.sybase.SybaseConnection56fc16 Design time metadata of query [2003331 6:35:46:363] Debug 50103 jdbcpds: JDBCUIEventHandler : handleOKEvent : Serialize XMLjdbcpds DTDVersion= 1.0JDBCQueryjdbcpdspkg.proc_with_ param1,2,3,4,5JDBCQueryQueryDefinition1QueryDefinitiondriverTypeoracle driverTypeconnectionClassoracle.reports.plugin.datasource.jdbcpds.JDBCConnect ionHandlingconnectionClassSignOnParameterP_ JDBCPDSSignOnParameterjdbcElementselementname = EMPNO type = 2 typeName = NUMBER columnSize = 4 columnScale = 0 element name = ENAME type = 12 typeName =VARCHAR2 columnSize = 10 columnScale = 0 element name = JOB type = 12 typeName = VARCHAR2 columnSize = 9 columnScale =0 element name = MGR type = 2 typeName = NUMBER columnSize = 4 columnScale = 0 element name = HIREDATE type = 93 typeName = DATE columnSize = 16 columnScale = 0 element name = SAL type = 2 typeName = NUMBER columnSize = 7 columnScale= 2 element name = COMM type = 2 typeName = NUMBER columnSize = 7 columnScale = 2 element name = DEPTNO type = 2 typeName = NUMBER columnSize = 2 columnScale = 0 jdbcElementsreferenceColumnsreferenceColumnsjdbcpds [2003331 6:35:46:383] Debug 50103 jdbcpds: JDBCUIEventHandler :handleOKEvent END Example 14–2 Running a JDBC Query [2003318 5:45:17:707] Debug 50103 jdbcpds: JDBCDataSource : startRuntime method : START Describing the JDBC Query: [2003318 5:45:17:707] Debug 50103 jdbcpds: JDBCDataSource : describe : START [2003318 5:45:17:707] Debug 50103 jdbcpds: applyXML: Extract the Serilzed XML 14-20 Publishing Reports to the Web with Oracle Reports Services containing Query Meta Data jdbcpds DTDVersion= 1.0JDBCQueryselect from empJDBCQueryQueryDefinition0QueryDefinitiondriverTypeoracledriverType connectionClassoracle.reports.plugin.datasource.jdbcpds.JDBCConnectionHandling connectionClass... ConnectionHandling At Runtime: [2003318 5:45:17:737] Debug 50103 jdbcpds: JDBCDataSource : startRuntime : Create a new connection and handle it [2003318 5:45:17:737] Debug 50103 jdbcpds: JDBCExecuteQuerySource : handleConnection : START [2003318 5:45:17:778] Debug 50103 jdbcpds: JDBCExecuteQuerySource : handleConnection : set driver [2003318 5:45:17:778] Debug 50103 jdbcpds: JDBCExecuteQuerySource : handleConnection : Check if Connection for the sign on parameter is pooled [2003318 5:45:17:778] Debug 50103 jdbcpds: JDBCExecuteQuerySource :handleConnection : connection available in pool [2003318 5:45:17:778] Debug 50103 jdbcpds: handleConnection : END [2003318 5:45:17:778] Debug 50103 jdbcpds: JDBCDataSource : startRuntime : END Runtime execution of jdbc query [2003331 6:36:2:836] Debug 50103 jdbcpds: JDBCDataSource : execute : run Query [2003331 6:36:2:836] Debug 50103 jdbcpds: JDBCExecuteQuerySource : getOutputFromDatabase : START [2003331 6:36:2:836] Debug 50103 jdbcpds: JDBCExecuteQuerySource : getOutputFromDatabase: start Query stringto be submitted jdbcpdspkg.proc_with_param1,2,3,4,5 [2003331 6:36:2:836] Debug 50103 jdbcpds: JDBCExecuteQuerySource : getOutputFromDatabase : check connection [2003331 6:36:2:836] Debug 50103 jdbcpds: JDBCExecuteQuerySource : getOutputFromDatabase : QSource Id: 1 [2003331 6:36:2:836] Debug 50103 jdbcpds: JDBCExecuteQuerySource: executeOracleProcedure:Start [2003331 6:36:2:836] Debug 50103 jdbcpds: JDBCExecuteQuerySource: executeOracleProcedure:Procedure to be submitted { call jdbcpdspkg.proc_with_param?,?,?,?,?,? } [2003331 6:36:2:836] Debug 50103 jdbcpds: JDBCExecuteQuerySource: executeOracleProcedure: Set parameters for the procedure call [2003331 6:36:2:836] Debug 50103 jdbcpds: JDBCExecuteQuerySource: executeOracleProcedure: execute procedure [2003331 6:36:2:847] Debug 50103 jdbcpds: JDBCDataSource : execute : query execution over andresulset object is oracle.jdbc.driver.OracleResultSetImpl751a9e [2003331 6:36:2:847] Debug 50103 jdbcpds: JDBCDataSource : execute : END Running Report trace with Result set info 200347 5:26:6:996] Debug 50103 jdbcpds: JDBCDataSource : execute : replace lexical columns withactual string for the query [200347 5:26:6:996] Debug 50103 jdbcpds: JDBCDataSource : execute : run Query [200347 5:26:6:996] Debug 50103 jdbcpds: JDBCExecuteQuerySource : getOutputFromDatabase : START [200347 5:26:6:996] Debug 50103 jdbcpds: JDBCExecuteQuerySource : getOutputFromDatabase: start Query stringto be submitted select from reports [200347 5:26:7:6] Debug 50103 jdbcpds: JDBCExecuteQuerySource : getOutputFromDatabase : check connection [200347 5:26:7:6] Debug 50103 jdbcpds: JDBCExecuteQuerySource : getOutputFromDatabase : QSource Id: 4 [200347 5:26:7:6] Debug 50103 jdbcpds: JDBCExecuteQuerySource : getOutputFromDatabase : Query source is SQL query [200347 5:26:7:6] Debug 50103 jdbcpds: JDBCExecuteQuerySource:executeQuery Start Configuring and Using the Pluggable Data sources 14-21 [200347 5:26:7:6] Debug 50103 jdbcpds: executeQuery prepareStatement select from reports [200347 5:26:7:6] Debug 50103 jdbcpds: executeQuery : bind parameters set for the query [200347 5:26:7:6] Debug 50103 jdbcpds: executeQuery : JDBC Query executed [200347 5:26:7:387] Debug 50103 jdbcpds: JDBCExecuteQuerySource : getOutputFromDatabase : Query result col 0 test col 1 10 [200347 5:26:7:387] Debug 50103 jdbcpds: JDBCExecuteQuerySource:executeQuery Start [200347 5:26:7:387] Debug 50103 jdbcpds: executeQuery prepareStatement select from reports [200347 5:26:7:387] Debug 50103 jdbcpds: executeQuery : bind parameters set for the query [200347 5:26:7:387] Debug 50103 jdbcpds: executeQuery : JDBC Query executed [200347 5:26:7:767] Debug 50103 jdbcpds: JDBCDataSource : execute : query execution over andresulset object is com.oracle.ias.jdbc.base.BaseResultSet56c3cf [200347 5:26:7:767] Debug 50103 jdbcpds: JDBCDataSource : execute : END

14.1.5 Adding Your Own JDBC Driver

The main tasks you must perform to add your JDBC PDS are: ■ Configuring the jdbcpds.conf File ■ Installing the Drivers JAR Files

14.1.5.1 Configuring the jdbcpds.conf File

For information on how to configure the jdbcpds.conf file, refer to Section 14.1.1, JDBC Configuration File .

14.1.5.2 Installing the Drivers JAR Files

For information on how to install the drivers JAR files, refer to Section 14.1.1.2.5, Custom Driver .

14.2 Configuring and Using Text PDS

Text PDS is configured and available out-of-the-box for Oracle Reports.

14.2.1 Text Configuration File

The textpds.conf file is the Oracle Reports Text PDS configuration file which can be changed, added, or deleted. The file is located at the following directories: ■ For Reports Server: Note: Oracle Reports exposes the PDS API and also contains a tutorial that describes in detail how to implement or customize your own PDS. For more information, refer to the Reports Software Development Kit RSDK, available on the Oracle Technology Network OTN: on the Oracle Reports page http:www.oracle.comtechnologyproductsreportsi ndex.html , click SDK. Using this API, you can implement an unlimited number of PDSs to access any kind of data sources that you have. 14-22 Publishing Reports to the Web with Oracle Reports Services ORACLE_INSTANCE\config\ReportsServerComponent\server_ name\textpdf.conf ■ For Oracle Reports Builder: ORACLE_ INSTANCE\config\ReportsToolsComponent\ReportsTools\textpdf.co nf ■ For Reports Application in-process Reports Server deployed in Oracle WebLogic Server: DOMAIN_HOMEconfigfmwconfigserversWLS_ REPORTSapplicationsreports_versionconfiguration Example The following example illustrates the contents of textpds.conf file: --XML section.Please edit this section to give your file format information-- textPDS xmlns=http:xmlns.oracle.comreportspdstext xmlns:xsi=http:www.w3.org2001XMLSchema-instance xsi:schemaLocation=http:xmlns.oracle.comreportspdstext file:c:\orawinreportsdtdtextpds.xsd --Data definition for Apache Log file format-- fileFormat name = Apache Log File comment = delimiter = default type =variable nullValue = - columnInfo column name = Remote Host type = string column name = Remote Log Name type = string column name = Remote User type = string column name = time type = date cellWrapper = \[] pattern = ddMMMyyyy:hh:mm:ss zzz column name = Request type = string cellWrapper = quot; column name = status type = number column name = bytes type = number columnInfo fileFormat --Data definition for Comma Delimited file format-- fileFormat name = Example Variable Width Comma Delimited comment = delimiter = , type = variable columnInfo column name = var_cd_col1 type = string column name = var_cd_col2 type = string column name = var_cd_col3 type = string columnInfo fileFormat --Data definition for Fixed Width format-- fileFormat name = Example Fixed Width Space Delimited comment = delimiter = type = fixed columnInfo column name = fw_sd_col1 type = string startpos = 1 width = 13 column name = fw_sd_col2 type = number startpos = 14 width = 10 column name = fw_sd_col3 type = date startpos = 25 width = 10 Configuring and Using the Pluggable Data sources 14-23 columnInfo fileFormat textPDS Table 14–13 outlines the various values that can be associated with a File Formats. Table 14–14 outlines the various values that can be associated with a Column.

14.3 Configuring and Using XML PDS

XML PDS is configured and available out-of-the-box.

14.3.1 XML PDS Configuration File

The xmlpds.conf file is the Oracle Reports XML PDS configuration file. It is located at the following directories: ■ For Reports Server: ORACLE_INSTANCE\config\ReportsServerComponent\server_name ■ For Oracle Reports Builder: Table 14–13 File Format Attributes Attribute Name Description name A File Format name, this name appears in the Data Definition drop down list Comment A Comment character, this will be used in the DataSource. Delimiter A Column Delimiter. The Data Source file contains data in rows. Each row has fields or tokens corresponding to the Columns specified in the configuration file. Each field or token will be separated by a Column delimiter See cellWrapper type A File Format Type which can be either a fixed or variable. In case of variable file format, the column width is variable. In case of fixed file format, the column width is fixed and is specified using the attributes startpos and width for each column. nullValue This is a null value character. Table 14–14 Column Attributes Attribute Name Description name This is the name of the Column Heading type This is the Column Data type. There are three data types that are supported: ■ String ■ Number ■ Date cell Wrapper This is an optional attribute. If specified, this character will override the File Format delimiter for the column for which it is specified. pattern This is an optional attribute. Currently it is used only for date fields. It specifies the pattern in which date field is to be expected. 14-24 Publishing Reports to the Web with Oracle Reports Services ORACLE_INSTANCE\config\ReportsToolsComponent\ReportsTools ■ For Reports Application in-process Reports Server deployed in Oracle WebLogic Server: DOMAIN_HOMEconfigfmwconfigserversWLS_ REPORTSapplicationsreports_versionconfiguration Example The following example illustrates the contents of xmlpds.conf file: xmlpds xmlns=http:xmlns.oracle.comreportspdsxml xmlns:xsi=http:www.w3.org2001XMLSchema-instance xsi:schemaLocation=http:xmlns.oracle.comreportspdsxml file:c:\orawinreportsdtdxmlpds.xsd columnInfo columnLength4000columnLength columnInfo xmlpds

14.4 Specifying the encoding of an XML PDS Report

When you create a report against an XML data source, you must ensure that the encoding of the data source and its DTD matches the encoding of Reports Builder. For example, when you create an XML report against a table encoded in a Japanese character set, the group element name is encoded in Japanese. To match the data source, you should encode the groups element name in the DTD in Japanese. The XML and DTD files can be in any encoding that supports Japanese, such as Shift_JIS, EUC-JP, or UTF-8. If you do not match the XML data source and DTD encoding to the Reports Builder encoding, you will see the following error: ERR-063001 xxx.dtd null To avoid this problem, ensure that both the XML data source and DTD for your XML report use the same encoding that you have in the character encoding part of the NLS_ LANG environment variable in effect for your Reports Runtime. For example, if NLS_LANG=JAPANESE_JAPAN.JA16SJIS for your Reports Runtime, then both your XML data source and DTD should use Shift_JIS. Note: The only parameter that can be changes is the columnLength. The default size of the column is 4000 bytes Note: You will not see this error if you use a XML schema instead of a DTD.