AW: AW: Problem with SQL Task jdbc
Hi! I tried the database user and DBO. That doesn't work but dbo works. I'll update the issue. Thanks Thoralf -Ursprüngliche Nachricht- Von: Andras Balogh [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 11. Juli 2006 16:48 An: Apache Torque Users List Betreff: Re: AW: Problem with SQL Task jdbc Hello, Do not set torque.database.schema to null. Try to set it to the name of the user who connects to the DB or to value DBO (or dbo) I had to add to SQL server so it might work for Sybase also. Best regards, Andras. Thoralf Rickert wrote: Okay, the property torque.database.schema has to be null - otherwise the driver returns an empty list of tables. But I cannot set it to null (comment out torque.database.schema results in a String with the content ${torque.database.schema}). I think this is a bug too - maybe sybase specific (it works with mysql). bye Thoralf - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with SQL Task jdbc
Hi! I try to generate a XML schema for a Sybase database. The problem is that the task runs without an error but the generated schema.xml is empty. I think, I forgot a property but I don't know which one. Here are my torque properties and the generated output: # torque.database.type= sybase torque.database.user= sa torque.database.password= password torque.database.driver = com.sybase.jdbc2.jdbc.SybConnectionPoolDataSource torque.database.url = jdbc:sybase:Tds:dbtest:2510/cadooz torque.database.validationQuery = SELECT 1 # torque.database.default = intershop torque.database.schema = intershop torque.database.intershop.adapter = sybase torque.dsfactory.intershop.factory = org.apache.torque.dsfactory.SharedPoolDataSourceFactory torque.dsfactory.intershop.pool.maxIdle = 8 torque.dsfactory.intershop.pool.maxActive = 10 torque.dsfactory.intershop.pool.maxWait = 1 torque.dsfactory.intershop.pool.timeBetweenEvictionRunsMillis = 30 torque.dsfactory.intershop.pool.minEvictableIdleTimeMillis = 360 torque.dsfactory.intershop.pool.testOnBorrow= true torque.dsfactory.intershop.pool.validationQuery = SELECT 1 torque.dsfactory.intershop.connection.driver= com.sybase.jdbc2.jdbc.SybConnectionPoolDataSource torque.dsfactory.intershop.connection.url = jdbc:sybase:Tds:dbtest:2510/cadooz torque.dsfactory.intershop.connection.user = sa torque.dsfactory.intershop.connection.password = password torque.manager.useCache = true # torque.home= . torque.project = intershop torque.database= sybase torque.targetPackage = com.cadooz.framework.intershop.database torque.subpackage.map = map torque.subpackage.manager = manager torque.runOnlyOnSchemaChange = false torque.output.dir = . torque.schema.dir = ${torque.home}/resources/schema/intershop torque.templatePath= ${torque.home}/resources/torque torque.doc.dir = ${torque.home}/doc torque.java.dir= ${torque.home}/src torque.ojb.dir = ${torque.home}/resources/torque torque.sql.dir = ${torque.home}/resources/schema/intershop torque.database.createUrl = jdbc:sybase:Tds:dbtest:2510/cadooz torque.database.buildUrl = jdbc:sybase:Tds:dbtest:2510/cadooz torque.database.url= jdbc:sybase:Tds:dbtest:2510/cadooz torque.database.host = dbtest torque.useManagers = false The console output is (I'm using ant) jdbc: [echo] +---+ [echo] | | [echo] | Generating XML from JDBC connection ! | [echo] | | [echo] +---+ [torque-jdbc-transform] Torque - JDBCToXMLSchema starting [torque-jdbc-transform] Your DB settings are: [torque-jdbc-transform] driver : com.sybase.jdbc2.jdbc.SybConnectionPoolDataSource [torque-jdbc-transform] URL : jdbc:sybase:Tds:dbtest.cadooz-ag.intern:2510/cadooz [torque-jdbc-transform] user : sa [torque-jdbc-transform] schema : intershop [torque-jdbc-transform] DB driver sucessfuly instantiated [torque-jdbc-transform] DB connection established [torque-jdbc-transform] Getting table list... [torque-jdbc-transform] Building column/table map... [torque-jdbc-transform] ./resources/schema/intershop/schema.xml [torque-jdbc-transform] Torque - JDBCToXMLSchema finished [echo] ...done. BUILD SUCCESSFUL Total time: 7 seconds This generates a XML file with the following content. ?xml version=1.0? !DOCTYPE database SYSTEM http://db.apache.org/torque/dtd/database_3_2.dtd; !-- Autogenerated by JDBCToXMLSchema! -- database name=sa/ Of course, there are more than 0 tables in this database. It's strange, that it sets the database name to the database user name sa. In org.apache.torque.task.TorqueJDBCTransformTask#generateXML line 196 is a bug: 195:databaseNode = doc.createElement(database); 196:databaseNode.setAttribute(name, dbUser); I think this should be something like: 196:databaseNode.setAttribute(name, dbName); Where dbName is the name of the database (I'll make a bug report). But that doesn't solve my problem. bye Thoralf - To unsubscribe, e-mail: [EMAIL PROTECTED]
AW: Problem with SQL Task jdbc
Okay, the property torque.database.schema has to be null - otherwise the driver returns an empty list of tables. But I cannot set it to null (comment out torque.database.schema results in a String with the content ${torque.database.schema}). I think this is a bug too - maybe sybase specific (it works with mysql). bye Thoralf -Ursprüngliche Nachricht- Von: Thoralf Rickert [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 11. Juli 2006 15:42 An: Apache Torque Users List Betreff: Problem with SQL Task jdbc Hi! I try to generate a XML schema for a Sybase database. The problem is that the task runs without an error but the generated schema.xml is empty. I think, I forgot a property but I don't know which one. Here are my torque properties and the generated output: # torque.database.type= sybase torque.database.user= sa torque.database.password= password torque.database.driver = com.sybase.jdbc2.jdbc.SybConnectionPoolDataSource torque.database.url = jdbc:sybase:Tds:dbtest:2510/cadooz torque.database.validationQuery = SELECT 1 # torque.database.default = intershop torque.database.schema = intershop torque.database.intershop.adapter = sybase torque.dsfactory.intershop.factory = org.apache.torque.dsfactory.SharedPoolDataSourceFactory torque.dsfactory.intershop.pool.maxIdle = 8 torque.dsfactory.intershop.pool.maxActive = 10 torque.dsfactory.intershop.pool.maxWait = 1 torque.dsfactory.intershop.pool.timeBetweenEvictionRunsMillis = 30 torque.dsfactory.intershop.pool.minEvictableIdleTimeMillis = 360 torque.dsfactory.intershop.pool.testOnBorrow= true torque.dsfactory.intershop.pool.validationQuery = SELECT 1 torque.dsfactory.intershop.connection.driver= com.sybase.jdbc2.jdbc.SybConnectionPoolDataSource torque.dsfactory.intershop.connection.url = jdbc:sybase:Tds:dbtest:2510/cadooz torque.dsfactory.intershop.connection.user = sa torque.dsfactory.intershop.connection.password = password torque.manager.useCache = true # torque.home= . torque.project = intershop torque.database= sybase torque.targetPackage = com.cadooz.framework.intershop.database torque.subpackage.map = map torque.subpackage.manager = manager torque.runOnlyOnSchemaChange = false torque.output.dir = . torque.schema.dir = ${torque.home}/resources/schema/intershop torque.templatePath= ${torque.home}/resources/torque torque.doc.dir = ${torque.home}/doc torque.java.dir= ${torque.home}/src torque.ojb.dir = ${torque.home}/resources/torque torque.sql.dir = ${torque.home}/resources/schema/intershop torque.database.createUrl = jdbc:sybase:Tds:dbtest:2510/cadooz torque.database.buildUrl = jdbc:sybase:Tds:dbtest:2510/cadooz torque.database.url= jdbc:sybase:Tds:dbtest:2510/cadooz torque.database.host = dbtest torque.useManagers = false The console output is (I'm using ant) jdbc: [echo] +---+ [echo] | | [echo] | Generating XML from JDBC connection ! | [echo] | | [echo] +---+ [torque-jdbc-transform] Torque - JDBCToXMLSchema starting [torque-jdbc-transform] Your DB settings are: [torque-jdbc-transform] driver : com.sybase.jdbc2.jdbc.SybConnectionPoolDataSource [torque-jdbc-transform] URL : jdbc:sybase:Tds:dbtest.cadooz-ag.intern:2510/cadooz [torque-jdbc-transform] user : sa [torque-jdbc-transform] schema : intershop [torque-jdbc-transform] DB driver sucessfuly instantiated [torque-jdbc-transform] DB connection established [torque-jdbc-transform] Getting table list... [torque-jdbc-transform] Building column/table map... [torque-jdbc-transform] ./resources/schema/intershop/schema.xml [torque-jdbc-transform] Torque - JDBCToXMLSchema finished [echo] ...done. BUILD SUCCESSFUL Total time: 7 seconds This generates a XML file with the following content. ?xml version=1.0? !DOCTYPE database SYSTEM http://db.apache.org/torque/dtd/database_3_2.dtd; !-- Autogenerated by JDBCToXMLSchema! -- database name=sa/ Of course
Re: AW: Problem with SQL Task jdbc
Hello, Do not set torque.database.schema to null. Try to set it to the name of the user who connects to the DB or to value DBO (or dbo) I had to add to SQL server so it might work for Sybase also. Best regards, Andras. Thoralf Rickert wrote: Okay, the property torque.database.schema has to be null - otherwise the driver returns an empty list of tables. But I cannot set it to null (comment out torque.database.schema results in a String with the content ${torque.database.schema}). I think this is a bug too - maybe sybase specific (it works with mysql). bye Thoralf - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]