I am a new comer to Sql2Java, and it looks to be a very useful tool. I have an existing database (Postgresql) and so I asked Sql2Java to generate the corresponding classes for that DB. It seems to have done that, no errors were generated during the process (a few of the tables had no Primary Key and generated warnings).
But, although it generated *Manager.java files, they were all of zero btyes. The only exception to this is Manager.java.
Obviously I have done something wrong, but I am unclear how to fix this. Any clues?
David
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I took the sample properties file and made those changes that I thought looked relevant. Having removed all the comments (to make this post manageable in size) the uncommented lines in section 1-4 are:-
I have actually moved a little from the original question, in that now that I have java5 I get the manager files, but even though they are in the exclude list I still get the *Cache.java, *Comparator.java, *Factory.java, *Factory.properties, *HttpFactory.java and *Listener.java files. The only two that should be generated are the two in java5 which are the Bean and the Manager files.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have used different versions of sql2java. It seems to me that what I am using currently works with nothing for the template.folder.exclude when there is something in the template.folder.include
I have also had problems jdbc.schema depending on the database.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is due to the "experimental" spdao feature. Just drop it out from the template.folder.include line.
Anytime you change the included or excluded templates (or the database), you should drop away the generated code. If you don't... the previously generated code will stay in the folders (and sometimes even give you compilation errors;-).
Hope this helps.
Alain.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am a new comer to Sql2Java, and it looks to be a very useful tool. I have an existing database (Postgresql) and so I asked Sql2Java to generate the corresponding classes for that DB. It seems to have done that, no errors were generated during the process (a few of the tables had no Primary Key and generated warnings).
But, although it generated *Manager.java files, they were all of zero btyes. The only exception to this is Manager.java.
Obviously I have done something wrong, but I am unclear how to fix this. Any clues?
David
Can you post your sql2java.properties file?
I took the sample properties file and made those changes that I thought looked relevant. Having removed all the comments (to make this post manageable in size) the uncommented lines in section 1-4 are:-
jdbc.type=postgresql
jdbc.driver=org.postgresql.Driver
jdbc.url=jdbc:postgresql://10.0.1.1:5432/jaliadb
jdbc.username=postgres
jdbc.password=postgres
jdbc.schema=public
generatedkey.retrieve=before
generatedkey.statement=SELECT nextval('<TABLE>_<KEY>_SEQ')
codewriter.package=uk.co.dga.myza.sql
codewriter.destdir=src/
velocity.templates.loadingpath=.;src/templates/velocity/includes
velocity.templates=src/templates/velocity/
static.templates=src/templates/static
codewriter.classprefix=
jdbc.tabletypes=TABLE, VIEW
jdbc.tablenamepattern=%
tables.include=
tables.exclude=
template.file.exclude=
template.file.include=
template.folder.exclude=factory spdao cache db
template.folder.include=java5
I have actually moved a little from the original question, in that now that I have java5 I get the manager files, but even though they are in the exclude list I still get the *Cache.java, *Comparator.java, *Factory.java, *Factory.properties, *HttpFactory.java and *Listener.java files. The only two that should be generated are the two in java5 which are the Bean and the Manager files.
I have used different versions of sql2java. It seems to me that what I am using currently works with nothing for the template.folder.exclude when there is something in the template.folder.include
I have also had problems jdbc.schema depending on the database.
Hello,
I got the same problem even with provided sample codes. Could somebody please help us figure out.
Thanks a lot
This is due to the "experimental" spdao feature. Just drop it out from the template.folder.include line.
Anytime you change the included or excluded templates (or the database), you should drop away the generated code. If you don't... the previously generated code will stay in the folders (and sometimes even give you compilation errors;-).
Hope this helps.
Alain.
Thanks, that helps