Hey all, I managed to succesfully generate my bean files for my project at work. But for some reason the beans get mapped to all the wrong variables. What even strange is that in the variables, the object type shows as $column.getJavaType() attachment Any ideas as to why it might be acting up?
Giuseppe, I'm assuming you are using the release version (2.6.7 is the latest). Unfortunately it looks like a lot of work has gone into the svn repo that didn't get released... If you have ant available, you should be able to just run ant generate in the unzipped directory. You can modify the build.xml file to have it point to the right sql2java.properties file (property sql2java-config). Or, you can copy your properties file into the config directory - that looks like it should work. If you don't...
Hi Charl, thanks for the answer. So, I have seen that example but when i configure that parameters, what do I have to do to generate the automatic code? This is my code: section 1/8 (db parameters) jdbc.type=mysql jdbc.driver=com.mysql.jdbc.Driver jdbc.url=jdbc:mysql://xxx.xxx.xx.xxx:3306/schema's name jdbc.username=** jdbc.password=* jdbc.schema=schema's name section 2/8 generatedkey.retrieve=after generatedkey.statement=SELECT last_insert_id() When I've done this, what should I do? I use mysql...
Hi Giuseppe, It has been a very long time since I used sql2java - I think there has been a release or two since I last used it. But, I do remember it being pretty easy to use. Did you read the example page here: http://sql2java.sourceforge.net/example.html ? It shows how you use ant to run the generator. It also provides a link to the sql2java.properties file, which is pretty well documented with comments. You really just need to set the appropriate jdbc settings - sections 1/8 and 2/8. Charl
Good afternoon all, I don't succeed to use slq2java. I'm working in a project that it was developed by other people. They used sql2java to generate code automatically; to continue in their way, I would use same approach. I added a table on db and I have readen that needs modify the file sql2java.properties, but what in particular? The database's parameters are equals (I use the same database than before). In addition to modifying the code of the sql2java.properties file,do I have to do something...