Author | Message |
---|---|
raylongma1018
Posts: 81
|
Posted 15:56 Jul 10, 2015 |
After I carefully read all your codes and also read the error messages. I finally figure out the problems and be able to test your codes!!. I still have question about database connections part. When I deploy your hibernate project, we configure jdbc connection by enter our username and password thru the persistence.xml, but in your tutorial we configure the connection in YOU-KNOW-WHAT.xml to setup our database name, username, and password. I found it's eaiser to configure the jdbc connection thru persistence.xml (since it has GUI) rather than from YOU-KNOW-WHAT.xml. Are we gonna configure jbdc connection in persistence.xml in the future? |
raylongma1018
Posts: 81
|
Posted 15:59 Jul 10, 2015 |
also for step4 testing part i got the following output: PASSED: getUser ===============================================
is that means it is working? |
cysun
Posts: 2935
|
Posted 16:03 Jul 10, 2015 |
There are more than one way to configure db connections. In a Spring web application it's better to configure it in the dataSource bean because then the data source can be used for JPA as well as other database access methods. For example, it's possible that part of your application uses JPA/Hibernate, and part of it uses JDBC to run some native SQL queries. If you configure it in persistence.xml, only JPA can use it. |
cysun
Posts: 2935
|
Posted 16:04 Jul 10, 2015 |
Yes. When it says PASSED, PASSED, Failures: 0, Skips: 0, it means it works. |
raylongma1018
Posts: 81
|
Posted 16:16 Jul 10, 2015 |
so this means in the future until end of this quarter we configure the db connection only by datasource bean? |
cysun
Posts: 2935
|
Posted 16:26 Jul 10, 2015 |
Yes. |