db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Swarn Dhaliwal" <sdhali...@aem-east.com>
Subject RE: Creating Database Schema
Date Fri, 18 Apr 2003 13:27:28 GMT
David,
 That worked very well. Thank you very much.

Regards,
Swarn

-----Original Message-----
From: David Hakim [mailto:dhakim@webcodex.com] 
Sent: Thursday, April 17, 2003 9:34 PM
To: Turbine Torque Users List
Subject: Re: Creating Database Schema

The MSSQL JDBC driver from microsoft has a weird behavior for when the  
getTables() method is called on connection metadata. If nothing is  
passed in for the schemaPattern, no tables are returned. This is what  
happens by default in the TorqueJDBCTransformTask. There is however a  
way around this. In your build.properties file, you can pass the  
property:

torque.database.schema = %

Now torque will generate the schema for all the tables in the database.

You may also be able to pass the database name itself as the value for  
this property ... I haven't tried that yet tho.

This does bring up a related, potential feature enhancement :) It sure  
would be nice if torque took a property for the tableNamePattern  
argument of getTables(). With it torque would be able to generate the  
XML schema for only those tables matching a specific pattern ... which  
would be awful handy :)

-Dave

On Thursday, April 17, 2003, at 06:51  PM, Swarn Dhaliwal wrote:

> Hi all,
> 	I have been trying to generate schema.xml from an MSSQLServer
> database using torque-jdbc task. The task seems to execute without any
> problems but the schema.xml file it generates is empty. Here is the
> information I used to run it and the output.
>
> torque.database.createUrl =
> jdbc:microsoft:sqlserver:// 
> hostname:1433;DatabaseName=mydbname;SelectMet
> hod=cursor
> torque.database.buildUrl =
> jdbc:microsoft:sqlserver:// 
> hostname:1433;DatabaseName=mydbname;SelectMet
> hod=cursor
> torque.database.url =
> jdbc:microsoft:sqlserver:// 
> hostname:1433;DatabaseName=mydbname;SelectMet
> hod=cursor
> torque.database.driver = com.microsoft.jdbc.sqlserver.SQLServerDriver
> torque.database.user = username
> torque.database.password = password
> torque.database.host = hostname
>
> The following output is generated
>
> <?xml version="1.0"?>
> <!DOCTYPE database SYSTEM
> "http://jakarta.apache.org/turbine/dtd/database.dtd">
> <!-- Autogenerated by JDBCToXMLSchema! -->
> <database/>
>
>
> Any advice as what am I doing wrong will be greatly appreciated.
>
> Regards,
> Swarn
>
> -----Original Message-----
> From: Rolf Jentsch [mailto:RJentsch@electronicpartner.de]
> Sent: Monday, April 14, 2003 8:14 AM
> To: Turbine Torque Users List; Ronny Walter
> Subject: Re: Creating Database Schema
>
> Hello,
>
> Am Montag, 14. April 2003 14:02 schrieb Ronny Walter:
>> Hello Mailinglist,
>>
>> Is there a possibility to get the Schema automaticly created? I have
a
>> large database with a lot of tables and i don't like to key in all
the
>> values. :-)
>>
>> Greetings Ronny
>
> there is the "jdbc" target in build-torque.xml. It will transfer most

> of
> the
> structure of your database into a schema.xml file.
>
> There are some problems with this task: you will loose all information
> about
> additional indexes, and you may loose the size of numeric fields. So  
> you
> will
> have to check the results.
>
> cu
> Rolf Jentsch
> Produktentwicklung EDV-Anwendungen für Mitglieder
> ElectronicPartner GmbH & Co. KG
> Düsseldorf
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message