Thank you for your help, what I want to know is whether it is possible to send the user and password connection, as parameters, or are statics to started SessionFactory?
mangelo wrote:
Remove all database connection parameters from your hibernate config file. Put a file called hibernate.properties in your classpath. You can then put your connection and cp30 information there.
Example:
Code:
hibernate.connection.driver_class=com.mysql.jdbc.Driver
hibernate.connection.url=jdbc:mysql://localhost:3306/mysql_db
hibernate.connection.username=root <-- who send this value, from my aplication? ##
hibernate.connection.password= <-- who send this value, from my aplication? ##
hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
hibernate.c3p0.min_size=5
hibernate.c3p0.max_size=20
hibernate.c3p0.timeout=300
hibernate.c3p0.max_statements=50
hibernate.c3p0.idle_test_period=3000
Hope this helps.
Mike.