ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject ignite git commit: IGNITE-1546 Fixed DB datasource code generation.
Date Fri, 25 Sep 2015 10:39:24 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843 8721cb529 -> 5b29c1ad8


IGNITE-1546 Fixed DB datasource code generation.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5b29c1ad
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5b29c1ad
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5b29c1ad

Branch: refs/heads/ignite-843
Commit: 5b29c1ad8eca2fcb0fd186033300ba125c4e8bea
Parents: 8721cb5
Author: Alexey Kuznetsov <akuznetsov@apache.org>
Authored: Fri Sep 25 17:39:25 2015 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Fri Sep 25 17:39:25 2015 +0700

----------------------------------------------------------------------
 .../main/js/routes/generator/generator-common.js  |  2 +-
 .../js/routes/generator/generator-properties.js   | 12 +++++++++++-
 .../src/main/js/routes/generator/generator-xml.js | 18 +++++++++++++++---
 3 files changed, 27 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/5b29c1ad/modules/control-center-web/src/main/js/routes/generator/generator-common.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/generator/generator-common.js b/modules/control-center-web/src/main/js/routes/generator/generator-common.js
index 9e8a34b..20e4673 100644
--- a/modules/control-center-web/src/main/js/routes/generator/generator-common.js
+++ b/modules/control-center-web/src/main/js/routes/generator/generator-common.js
@@ -249,7 +249,7 @@ $generatorCommon.jdbcDialectClassName = function(db) {
 // Pairs of supported databases and their data sources.
 $generatorCommon.DATA_SOURCES = {
     Oracle: 'oracle.jdbc.pool.OracleDataSource',
-    DB2: 'com.ibm.db2.jcc.DB2ConnectionPoolDataSource',
+    DB2: 'com.ibm.db2.jcc.DB2DataSource',
     SQLServer: 'com.microsoft.sqlserver.jdbc.SQLServerDataSource',
     MySQL: 'com.mysql.jdbc.jdbc2.optional.MysqlDataSource',
     PostgreSQL: 'org.postgresql.ds.PGPoolingDataSource',

http://git-wip-us.apache.org/repos/asf/ignite/blob/5b29c1ad/modules/control-center-web/src/main/js/routes/generator/generator-properties.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/generator/generator-properties.js
b/modules/control-center-web/src/main/js/routes/generator/generator-properties.js
index 9c1f34b..c935b93 100644
--- a/modules/control-center-web/src/main/js/routes/generator/generator-properties.js
+++ b/modules/control-center-web/src/main/js/routes/generator/generator-properties.js
@@ -47,7 +47,17 @@ $generatorProperties.dataSourcesProperties = function (cluster) {
                     if (!_.contains(datasources, beanId)) {
                         datasources.push(beanId);
 
-                        res.line(beanId + '.jdbc.url=YOUR_JDBC_URL');
+                        switch (storeFactory.dialect) {
+                            case 'DB2':
+                                res.line(beanId + '.jdbc.server_name=YOUR_JDBC_SERVER_NAME');
+                                res.line(beanId + '.jdbc.port_number=YOUR_JDBC_PORT_NUMBER');
+                                res.line(beanId + '.jdbc.database_name=YOUR_JDBC_DATABASE_TYPE');
+                                res.line(beanId + '.jdbc.driverType=YOUR_JDBC_DRIVER_TYPE');
+                                break;
+
+                            default:
+                                res.line(beanId + '.jdbc.url=YOUR_JDBC_URL');
+                        }
                         res.line(beanId + '.jdbc.username=YOUR_USER_NAME');
                         res.line(beanId + '.jdbc.password=YOUR_PASSWORD');
                         res.line();

http://git-wip-us.apache.org/repos/asf/ignite/blob/5b29c1ad/modules/control-center-web/src/main/js/routes/generator/generator-xml.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/generator/generator-xml.js b/modules/control-center-web/src/main/js/routes/generator/generator-xml.js
index 545d881..71bc81e 100644
--- a/modules/control-center-web/src/main/js/routes/generator/generator-xml.js
+++ b/modules/control-center-web/src/main/js/routes/generator/generator-xml.js
@@ -631,7 +631,8 @@ $generatorXml.cacheStore = function(cache, res) {
                     }) < 0) {
                     res.datasources.push({
                         dataSourceBean: storeFactory.dataSourceBean,
-                        className: $generatorCommon.DATA_SOURCES[storeFactory.dialect]
+                        className: $generatorCommon.DATA_SOURCES[storeFactory.dialect],
+                        dialect: storeFactory.dialect
                     });
                 }
             }
@@ -1064,8 +1065,19 @@ $generatorXml.cluster = function (cluster, clientNearCfg) {
             _.forEach(res.datasources, function (item) {
                 var beanId = item.dataSourceBean;
 
-                xml += '    <bean id= "' + beanId + '" class="' + item.className + '">\n';
-                xml += '        <property name="URL" value="${' + beanId + '.jdbc.url}"
/>\n';
+                xml += '    <bean id="' + beanId + '" class="' + item.className + '">\n';
+                switch (item.dialect) {
+                    case 'DB2':
+                        xml += '        <property name="serverName" value="${' + beanId
+ '.jdbc.server_name}" />\n';
+                        xml += '        <property name="portNumber" value="${' + beanId
+ '.jdbc.port_number}" />\n';
+                        xml += '        <property name="databaseName" value="${' + beanId
+ '.jdbc.database_name}" />\n';
+                        xml += '        <property name="driverType" value="${' + beanId
+ '.jdbc.driver_type}" />\n';
+                        break;
+
+                    default:
+                        xml += '        <property name="URL" value="${' + beanId + '.jdbc.url}"
/>\n';
+                }
+
                 xml += '        <property name="user" value="${' + beanId + '.jdbc.username}"
/>\n';
                 xml += '        <property name="password" value="${' + beanId + '.jdbc.password}"
/>\n';
                 xml += '    </bean>\n\n';


Mime
View raw message