I've added the mysql-connector-java-5.1.15-bin.jar driver in the project path and in the bin directory of Tomcat.
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Vijitha Kumara wrote:
I've added the mysql-connector-java-5.1.15-bin.jar driver in the project path and in the bin directory of Tomcat.
Tomcat bin includes the executables for the Tomcat itself. Not the application jar files. Place the driver jar files in the lib directory corresponds to your Tomcat version.
I suggest you start with a simple setup which may insert an entity using Hibernate to work in the first place.
~With Smile<br />VK
I want to do the join between both tables as well, e.g., get the country of a specified student, all at the class level. I don't want to do this with a JOIN HQL statements, and i think the best way is using Criteria, am i right?
Regards
Shalindra Singh
SCJP, SCWCD
Regards
Shalindra Singh
SCJP, SCWCD
shalindra Singh Suryvanshee wrote:Hi Hernan!
I would like to indicate following things from your code -
1. error thrown indicate that your application is not able to pick the correct driver jar file. Sometimes this could be the problem with Tomcat. Can you please put the driver jar file in WEB-INF/lib (application library) instead of tomcat lib (server library).
2. I feel you would not like to save OR update country while updating records in Student table. I am not sure is required ?
3. I am not very sure how to do the same using annotation, but in .hbm file I would write in following way -
you should notice of use of many-to-many node and property node for country.
Let me know if you have any doubt .
Regards
Shalindra Singh
SCJP, SCWCD
shalindra Singh Suryvanshee wrote:Hi Hernan!
you should be able to resolve your problem with the code I attached -
Here there are following things which need attention -
1. please observe last two line. both are written for student_country column
2. getter and setter method should be present for both 'country' and 'studentCountry' property in Student DTO.
3. you should use 'studentCountry' property to create criteria (as you already doing).
Regards
Shalindra Singh
SCJP, SCWCD
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |