* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Now
Survey
Document related concepts
Transcript
™ DirXML Configuring Drivers for JDBC, iPlanet, and Delimited Text www.novell.com Jason Elsberry Software Engineer Novell, Inc. [email protected] Steve Trottier Software Engineer Novell, Inc. [email protected] Vision…one Net A world where networks of all types—corporate and public, intranets, extranets, and the Internet—work together as one Net and securely connect employees, customers, suppliers, and partners across organizational boundaries Mission To solve complex business and technical challenges with Net business solutions that enable people, processes, and systems to work together and our customers to profit from the opportunities of a networked world What Do these Drivers Have in Common? • They are all multi-purpose Directories (LDAP Driver) Databases (JDBC Driver) Text Files (Delimited Text Driver) • Creative use of style sheets allows drivers to be flexible DirXML™ Overview • DirXML allows data synchronization between Novell eDirectory™ and other applications, directories and databases • Novell eDirectory acts as the data “hub” • Data can flow from an application into eDirectory (publisher channel) or from eDirectory into an application (subscriber channel) DirXML Overview (cont.) • Two main types of DirXML configuration DirXML rules • DirXML rules are optional • DirXML rules define or modify the driver behavior XSLT • • • • style sheets XSLT is a standard way of modifying source XML documents Any DirXML rule can be replaced by an XSLT style sheet XSLT style sheets can be more flexible than DirXML rules XSLT is usually more difficult to learn than DirXML rules DirXML Overview (cont.) • Other elements of DirXML configuration Sample driver configuration (import files) DirXML objects • • • • • Driver set objects Driver objects Subscriber channel objects Publisher channel objects Filters DirXML Driver for LDAP • Supported LDAP servers Netscape Directory Server 4.12 iPlanet Directory Server 5.0 IBM SecureWay Directory Critical Path InJoin Server Others are untested, but may work • Requires standard LDAPv3 compliance • Publisher channel requires LDAP change log LDAP Sample Configuration • Supports bi-directional data synchronization • New entries are synchronized in a flat fashion When an entry is added anywhere on the LDAP server, it gets synchronized to a single specified container in eDirectory When an entry is added anywhere in eDirectory, it gets synchronized to a single specified container in the LDAP server LDAP Sample Configuration • Specific rules to match the default Netscape/iPlanet behavior User objects added to eDirectory get named with “cn” User objects added to the LDAP server get named with “uid” Changing the Sample Configuration • If we wanted a mirrored subtree structure Change placement rule Make sure everything we want to synchronize is in the filter and the schema map DirXML Driver for Delimited Text • Rather than interacting directly with any application, the Delimited Text driver operates on text files stored on the local file system • Publisher channel processes input files • Subscriber channel creates output files DirXML Driver for Delimited Text (cont.) • Sample configuration supports Comma-separated value files (CSV) DirXML formatted XML files (XDS) • Other file types require customized style sheets Input files must represent an entry (user) either with a single line of data, or as XML Style sheets convert single-line data input, or XML input, to a <record> and <field> XML structure DirXML Driver for Delimited Text (cont.) <record name=‘Joe Brown’> <field name=‘First Name’>Joe</field> <field name=‘Last Name’>Brown</field> <field name=‘Title’>Engineer</field> <field name=‘Department’>IS</field> </record> DirXML Driver for JDBC • Supported Databases Oracle 8i, 9i IBM DB2 Universal Database (UDB) 7.x Microsoft SQL Server 7.x/2000 Sybase Adaptive Server Enterprise (ASE) 12.x DirXML Driver for JDBC • Minimum Database Requirements Support SQL grammar used by the driver • SQL92 entry level? JDBC-accessible • Third-party JDBC driver • Third-party ODBC driver via Sun’s JDBC-ODBC Bridge Support Schemas • A schema is a logical grouping of database objects owned by a particular database user • Example – Microsoft Access does not support schemas DirXML Driver for JDBC (cont.) • Supported Data Types JDBC 1.0 data types (java.sql.Types) • time, date, timestamp • char, varchar, long varchar • binary, varbinary, long varbinary DirXML Driver for JDBC (cont.) • 1.5 Features Embedded SQL • Allows for virtual database triggers • Allows for native SQL queries • Facilitates user account management Extended Set of Compatibility Parameters • Further generalize the driver • Allows for use with more databases and third-party JDBC/ODBC drivers <add class-name=“EMP”> <add-attr name=“LNAME”> <value>Elsberry</value> </add-attr> </add> <jdbc:statement> <jdbc:sql>UPDATE EMP SET FNAME = ‘Jason’</jdbc:sql> </jdbc:statement> INSERT INTO EMP(LNAME) VALUES(‘Elsberry’) UPDATE EMP SET FNAME = ‘Jason’ <add class-name=“EMP” jdbc:transaction-id=“0”> <add-attr name=“LNAME”> <value>Elsberry</value> </add-attr> </add> <jdbc:statement jdbc:type=“manual” jdbc:transaction-id=“0”> <jdbc:sql>UPDATE EMP SET FNAME = ‘Jason’</jdbc:sql> </jdbc:statement> Manual Transaction 0 INSERT INTO EMP(LNAME) VALUES(‘Elsberry’) UPDATE EMP SET FNAME = ‘Jason’ DirXML Driver for JDBC • Embedded SQL Previously, the driver only synchronized data using Data Manipulation (DML) statements • E.g., SELECT, INSERT, UPDATE, DELETE Embedded SQL support allows the driver to execute Data Definition (DDL) statements as a side effect of data synchronization • E.g., CREATE USER, DROP USER <add class-name=“EMP”> <add-attr name=“LNAME”> <value>Elsberry</value> </add-attr> </add> <jdbc:statement> <jdbc:sql> <xsl:text>CREATE USER JELSBERRY </xsl:text> <xsl:text>IDENTIFIED BY NOVELL</xsl:text> </jdbc:sql> </jdbc:statement> INSERT INTO EMP(LNAME) VALUES(‘Elsberry’) CREATE USER ELSBERRY IDENTIFIED BY NOVELL DirXML Driver for JDBC • Compatibility Parameters Further generalize the driver • Nine new driver parameters • One new subscriber parameter • One new publication parameter Compatibility parameters are optional DirXML Driver for JDBC (cont.) • Driver Compatibility Parameters Reuse statements? Use manual transactions? Use single connection? Default transaction isolation level Retrieve minimal metadata? Use qualified table names? Handle statement results? Connection initialization string Connection tester class DirXML Driver for JDBC (cont.) • Reuse Statements? If set to “no”, the driver reallocates java.sql.Statement objects for each operation If set to “yes” (default), java.sql.Statement objects are allocated the first time they are used and reused for each subsequent operation Example • Microsoft’s JDBC Driver for SQL Server 2000 does not allow multiple java.sql.PreparedStatement objects to be allocated when a manual transaction is in progress DirXML Driver for JDBC (cont.) • Retrieve Minimal Metadata? If set to “no” (default), the driver calls required and optional metadata methods If set to “yes,” the driver only calls required metadata methods Example • The Progress JDBC driver does not support the optional metadata method DatabaseMetaData.getExportedKeys(). DirXML Driver for JDBC (cont.) • Handle Statement Results? If set to “no,” the driver will not handle results generated from the Statement.execute() method If set to “yes” (default), the driver will handle results generated from the Statement.execute() method Example • Microsoft’s ODBC driver does not support retrieval of result sets from this method via Sun’s JDBC-ODBC bridge driver • IBM’s JDBC driver for DB2 UDB requires that statement results be handed before output parameters are retrieved from a stored procedure DirXML Driver for JDBC (cont.) • Connection Initialization String Allows users to define statements to execute at connection time Example • In order to facilitate user account management on Sybase, the driver’s login account must be granted system administrator rights • Making the driver a sys admin, however, forces it to login to the “master” database instead of the database specified in the driver’s authentication parameters • This parameter can be used to change database contexts at connection time DirXML Driver for JDBC (cont.) • Connection Tester Class There is no method defined in the JDBC interface to determine connection state • The java.sql.Connection.isClosed() method generally returns true only if you’ve explicitly called the close() method This parameter allows users to define a databasespecific class to determine connection state Example • The Microsoft SQL Server connection tester class MSSQLConnectionTester executes the statement SELECT NULL FROM sysusers WHERE -1=0. DirXML Driver for JDBC (cont.) • Subscriber Compatibility Parameters Key Generation Timing DirXML Driver for JDBC (cont.) • Key Generation Timing When should the driver attempt to retrieve primary key values with <add> events? Before or after rows are inserted into a table? Possible values • Before (default) • After Example • For Oracle, values are available before insertion via sequence objects; for Microsoft SQL Server, DB2, and Sybase ASE, primary key values are generally available after insertion through identity columns DirXML Driver for JDBC (cont.) • Publisher Compatibility Parameters Allow Loopback? DirXML Driver for JDBC (cont.) • Allow Loopback? If set to “no” (default), the publisher will only process events caused by a database user other than itself If set to “yes,” the publisher will process events caused by any database user Example • In order to facilitate user account management on Sybase, the driver’s database login account has to be granted system administrator rights • Making the driver a sys admin, however, changes the driver’s identity to “dbo” • Because the driver’s identity is no longer unique, the publisher is unable to determine whether an event was caused by the subscriber or another database user with sys admin rights