Changeset 6424957483d23860b95cf0187b855eb506111efc
- Timestamp:
- 08/13/07 18:01:23
(1 year ago)
- Author:
- Christopher Jung <bktheg@web.de>
- git-committer:
- Christopher Jung <bktheg@web.de> 1187020883 +0200
- git-parent:
[d95781aec2dc06ce9cdc85dff7e630bab6b21e4d]
- git-author:
- Christopher Jung <bktheg@web.de> 1187020883 +0200
- Message:
Die Datenbankverbindungsdaten stehen nun nur noch in der config.xml
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r580809c |
r6424957 |
|
| 49 | 49 | conf = new AnnotationConfiguration(); |
|---|
| 50 | 50 | conf.configure(new File(Configuration.getSetting("configdir")+"hibernate.xml")); |
|---|
| | 51 | |
|---|
| | 52 | // Datenbankverbindung eintragen |
|---|
| | 53 | conf.setProperty("connection.url", "jdbc:mysql://"+Configuration.getSetting("db_server")+"/"+Configuration.getSetting("db_database")); |
|---|
| | 54 | conf.setProperty("connection.username", Configuration.getSetting("db_user")); |
|---|
| | 55 | conf.setProperty("connection.password", Configuration.getSetting("db_password")); |
|---|
| | 56 | |
|---|
| | 57 | // Einige Funktionen hinzufuegen |
|---|
| 51 | 58 | conf.addSqlFunction("pow", new StandardSQLFunction("pow", Hibernate.DOUBLE)); |
|---|
| 52 | 59 | conf.addSqlFunction("floor", new StandardSQLFunction("floor", Hibernate.LONG)); |
|---|
| … | … | |
| 55 | 62 | conf.addSqlFunction("bit_or", new SQLFunctionTemplate(Hibernate.INTEGER, "?1 | ?2")); |
|---|
| 56 | 63 | |
|---|
| | 64 | // Mappings lesen |
|---|
| 57 | 65 | try { |
|---|
| 58 | 66 | Document doc = XMLUtils.readFile(Configuration.getSetting("configdir")+"hibernatemappings.xml"); |
|---|
| r3924571 |
r6424957 |
|
| 6 | 6 | <session-factory> |
|---|
| 7 | 7 | <property name="connection.driver_class">com.mysql.jdbc.Driver</property> |
|---|
| 8 | | <property name="connection.url">jdbc:mysql://localhost/ds2</property> |
|---|
| 9 | | <property name="connection.username">root</property> |
|---|
| 10 | | <property name="connection.password"></property> |
|---|
| 11 | 8 | |
|---|
| 12 | 9 | <!-- C3P0 connection pool --> |
|---|