Show last authors
1 **Add A JDBC Driver**
2
3 This document describes the process to add a new JDBC data base driver to DigDash Enterprise.
4
5 Requirement: The JDBC driver as a JAR file, and its documentation
6
7 **I.Installation**
8
9 **1/** (optional, if the webapps have not been already deployed). Start your DigDash Enterprise Server and wait for the webapps to be fully deployed
10
11 **2/** Stop the server
12
13 **3/** copy the driver's JAR file into the following folder:
14
15 **<DD Install>\apache-tomcat\webapps\ddenterpriseapi\WEB-INF\lib**
16
17 **4/** The JDBC driver must be registered within DigDash Enterprise Server. To do this, edit the following file:
18
19 **<DD Install>\apache-tomcat\webapps\ddenterpriseapi\WEB-INF\classes\resources\config\sqldriverrepository.xml**
20
21 Add an XML entry to the sqldriverrepository.xml that looks like the following sample:
22
23 {{code language="XML"}}
24 <SQLDriver id="MY_DRIVER"
25 name="My Driver"
26 url="mydriver:"
27 manufacturer="My Driver Company"
28 class="com.mydriver.MyDriver"
29 urlsample="jdbc:mydriver:<database>?<options>"
30 availability="both">
31 <properties></properties>
32 </SQLDriver>
33 {{/code}}
34
35 (% class="box warningmessage" %)
36 (((
37 //Important: Some characters are reserved in XML: '**&**', '**"**', '**<**' or '**>**'//
38 )))
39
40 //So if you use some of these characters, make sure you encode them to their corresponding XML entities~://
41
42 * **&** => **&amp;**
43 * **"** => **&quot;**
44 * **<** => **&lt;**
45 * **>** => **&gt;**
46
47 Example:
48
49 (% class="box" %)
50 (((
51 * (WRONG) urlsample="jdbc:mydriver:dbtest?opt1=0&opt2="value""
52 * (RIGHT) urlsample="jdbc:mydriver:dbtest?opt1=0&amp;opt2=&quot;value&quot;"
53 )))
54
55 Parameters:
56
57 * **id**: An identifier used by DigDash internally, choose any non existent string, the convention is uppercase, no spaces
58
59 * **name**: The driver's name to be displayed in the user interface of the administration console
60
61 * **url**: jdbc URL prefix (without "jdbc:"). See driver's documentation
62
63 * **manufacturer**: Name of the driver's vendor/developer
64
65 * **class**: java class path of the main driver class. See driver's documentation.
66 Optional: JDBC drivers compliant with JDBC 4 do not need a driver class. Keep the class attribute empty (class="") in that case.
67
68 * **urlsample**: User friendly URL sample for the user interface of the administration console.
69
70 * **availability**: reserved. Leave it at "both".
71
72 (% class="box warningmessage" %)
73 (((
74 //Important: The deployment is lost when upgrading ddenterpriseapi.war file.//
75 //Please follow the deployment guide each time you upgrade DigDash Enterprise//
76 )))
77
78 You can find some sample of XML for drivers not provided in DigDash enterprise in **sqldriverrepository.xml** file.
79
80 __**Specific properties (advanced)**__
81
82 You can specify secific properties on some JDBC drivers. These properties are written inside the <properties></properties> tag, under the following format:
83
84 <properties>
85
86 **<property name="property_name" value="property_value" />**
87
88 <properties>
89
90 Supported properties are:
91
92 **FORCE_FORWARD_ONLY** (undefined | false | true)
93
94 Description: specifies the type of JDBC result set cursor used by the Studio for the preview of the SQL query results. By default the Studio uses a TYPE_INSENTIVE_SCROLL cursor to preview the results, but some of the databases do not support this type of cursor. If your driver or database only supports TYPE_FORWARD_ONLY cursors you can specify it with FORCE_FORWARD_ONLY property. Possible values:
95
96 * **false** (or **undefined property**): The type of cursor is automatic, TYPE_SCROLL_INSENTIVE in most of the cases, except for HIVE, IMPALA and SAPHANA
97 * **true**: The type of cursor used in the Studio is TYPE_FORWARD_ONLY
98
99 **PING_SQL **(undefined | SQL query | empty string)
100
101 Description: DigDash Enterprise tests the connection with the database by using the JDBC method **Connection.isValid()**. On some drivers this method does not work. In that case DigDash uses an alternative method to “ping” the database, usually by sending a “select 1” statement.
102
103 The PING_SQL property allows you to specify this SQL statement depending on your driver or database. Possible values:
104
105 * **Undefined property**: The alternative ping query is automatically decided by DigDash: “select 1” except for ORACLE, FIREBIRD, SAPHANA, DB2_AS400 or DB2 drivers
106 * **SQL query (not empty)**: the specified query is used to ping the databse. Example:
107 <property name="PING_SQL" value="select 1 from all_tables" />
108 * **Empty string**: Special case used to deactivate the ping in the case the JDBC method Connection.isValid() fails. The database is considered to be always accessible. Example:
109 <property name="PING_SQL" value="" />
110
111 **USE_FETCH_FIRST_IN_STUDIO** (undefined | false | true)
112
113 Description: This property is used only for preview the SQL result in the data source configuration dialog (Studio). It modifies the query by adding “FETCH FIRST n ROWS ONLY” to it (n is replaced byt the number of preview rows). It is useful for drivers that do not support JDBC’s **Statement.setMaxRows(n)**, for example AS400 JDBC driver. Possible values:
114
115 * **false** (or **undefined property**): The preview limit is defined by using JDBC method **Statement.setMaxRows(n)**
116 * **true**: Preview limit is defined by adding FERTCH FIRST n ROWS ONLY to the SQL in the Studio.
117
118 **FORBID_POOL_CONNECTION** (undefined | false | true)
119
120 Description: Prevents DigDash Enterprise from using a JDBC connection pool for this driver. A JDBC connection pool optimizes access to the data base by keeping connections in an opened state, and reuse them for different queries. In some cases it is preferred to not use a JDBC connection pool, for example to ensure that connections will not stay opened too long on the data base after they have been used for a query. This property answers that need. Possible values:
121
122 * **false** (or **undefined property**): A JDBC connection pool may be used by the driver
123 * **true**: The JDBC connection pool will not be used by the driver and each SQL query will have its own connection.

Sommaire

DigDash Enterprise [2021R1] User Guides
Deployment
Customisation
Base de connaissances

Copyright ©2006-2023 DigDash SAS