Configure various database links in Hibernate configuration files

Source: Internet
Author: User
Tags db2 interbase postgresql sybase

hibernate.properties######################### query Language ########################### define query Language Constants/function nameshibernate.query.substitutions yes ' Y ', no ' N ' # # # Select the classic query parser#hibernate.query. Factory_class org.hibernate.hql.classic.classicquerytranslatorfactory#################### Platforms ############# ######### JNDI Datasource#hibernate.connection.datasource jdbc/test#hibernate.connection.username db2# Hibernate.connection.password db2## Hypersonicsqlhibernate.dialect Org.hibernate.dialect.HSQLDialecthibernate.connection.driver_class Org.hsqldb.jdbcDriverhibernate.connection.username sahibernate.connection.passwordhibernate.connection.url JDBC: Hsqldb:./build/db/hsqldb/hibernate#hibernate.connection.url jdbc:hsqldb:hsql://localhost# Hibernate.connection.url jdbc:hsqldb:test## H2 (www.h2database.com) #hibernate. dialect Org.hibernate.dialect.h2dialect#hibernate.connection.driver_class Org.h2.driver#hibernate.connection.username SA #hibernate. ConnectiOn.password#hibernate.connection.url Jdbc:h2:mem:./build/db/h2/hibernate#hibernate.connection.url Jdbc:h2:testdb /h2test#hibernate.connection.url Jdbc:h2:mem:imdb1#hibernate.connection.url jdbc:h2:tcp://dbserv:8084/sample; #hibernate. Connection.url jdbc:h2:ssl://secureserv:8085/sample; #hibernate. Connection.url jdbc:h2:ssl://secureserv/testdb;cipher=aes## Mysql#hibernate.dialect Org.hibernate.dialect.mysqldialect#hibernate.dialect Org.hibernate.dialect.mysqlinnodbdialect#hibernate.dialect Org.hibernate.dialect.mysqlmyisamdialect#hibernate.connection.driver_class com.mysql.jdbc.driver# Hibernate.connection.url Jdbc:mysql:///test#hibernate.connection.username gavin#hibernate.connection.password## Oracle#hibernate.dialect Org.hibernate.dialect.oracledialect#hibernate.dialect Org.hibernate.dialect.oracle9dialect#hibernate.connection.driver_class oracle.jdbc.driver.oracledriver# Hibernate.connection.username Ora#hibernate.connection.password Ora#hibernate.connection.url jdbc:oracle:thin:@ LocalHost:1521:orcl#hibernate.connection.url Jdbc:oracle:thin: @localhost: 1522:xe## postgresql#hibernate.dialect Org.hibernate.dialect.postgresqldialect#hibernate.connection.driver_class org.postgresql.driver# Hibernate.connection.url Jdbc:postgresql:template1#hibernate.connection.username pg# hibernate.connection.password## Db2#hibernate.dialect org.hibernate.dialect.db2dialect# Hibernate.connection.driver_class Com.ibm.db2.jcc.db2driver#hibernate.connection.driver_class Com.ibm.db2.jdbc.app.db2driver#hibernate.connection.url jdbc:db2://localhost:50000/somename# Hibernate.connection.url jdbc:db2:somename#hibernate.connection.username Db2#hibernate.connection.password db2## Timesten#hibernate.dialect Org.hibernate.dialect.timestendialect#hibernate.connection.driver_class Com.timesten.jdbc.timestendriver#hibernate.connection.url jdbc:timesten:direct:test# hibernate.connection.username#hibernate.connection.password## Db2/400#hibernate.dialect Org.hibernate.dialect.db2400dialect#hibernate.connection. Username User#hibernate.connection.password password## Native driver#hibernate.connection.driver_class Com.ibm.db2.jdbc.app.db2driver#hibernate.connection.url jdbc:db2://systemname## Toolbox driver# Hibernate.connection.driver_class Com.ibm.as400.access.as400jdbcdriver#hibernate.connection.url jdbc:as400:// systemname## Derby (not supported!) #hibernate. Dialect Org.hibernate.dialect.derbydialect#hibernate.connection.driver_class org.apache.derby.jdbc.embeddeddriver#hibernate.connection.username#hibernate.connection.password# Hibernate.connection.url jdbc:derby:build/db/derby/hibernate;create=true## Sybase#hibernate.dialect Org.hibernate.dialect.sybasedialect#hibernate.connection.driver_class com.sybase.jdbc2.jdbc.sybdriver# Hibernate.connection.username Sa#hibernate.connection.password Sasasa#hibernate.connection.url Jdbc:sybase:Tds: co3061835-a:5000/tempdb## Mckoi Sql#hibernate.dialect org.hibernate.dialect.mckoidialect# Hibernate.connection.driver_class Com.mckoi.jdbcdriver#hibernate.conneCtion.url jdbc:mckoi:///#hibernate. Connection.url jdbc:mckoi:local://c:/mckoi1.0.3/db.conf# Hibernate.connection.username Admin#hibernate.connection.password nimda## SAP db#hibernate.dialect Org.hibernate.dialect.sapdbdialect#hibernate.connection.driver_class com.sap.dbtech.jdbc.driversapdb# Hibernate.connection.url Jdbc:sapdb://localhost/tst#hibernate.connection.username test# Hibernate.connection.password test#hibernate.query.substitutions yes ' Y ', no ' N ' # # MS SQL server#hibernate.dialect Org.hibernate.dialect.sqlserverdialect#hibernate.connection.username Sa#hibernate.connection.password sa## JSQL Driver#hibernate.connection.driver_class com.jnetdirect.jsql.jsqldriver#hibernate.connection.url JDBC: jsqlconnect://1e1/test## Jturbo Driver#hibernate.connection.driver_class com.newatlanta.jturbo.driver.driver# Hibernate.connection.url jdbc:jturbo://1e1:1433/test## WebLogic Driver#hibernate.connection.driver_class Weblogic.jdbc.mssqlserver4.driver#hibernate.connection.url Jdbc:weblogic:mssqlserver4:1e1:1433## Microsoft Driver (not recommended!) #hibernate. Connection.driver_class com.microsoft.jdbc.sqlserver.sqlserverdriver#hibernate.connection.url jdbc: Microsoft:sqlserver://1e1;databasename=test; selectmethod=cursor## the New Microsoft Driver #hibernate. Connection.driver_class Com.microsoft.sqlserver.jdbc.sqlserverdriver#hibernate.connection.url jdbc:sqlserver://localhost## JTDS (since Version 0.9) #hibernate. Connection.driver_class net.sourceforge.jtds.jdbc.driver#hibernate.connection.url jdbc: jtds:sqlserver://1e1/test## Interbase#hibernate.dialect org.hibernate.dialect.interbasedialect# Hibernate.connection.username Sysdba#hibernate.connection.password masterkey## do not specify hibernate.connection.sqldialect## Interclient#hibernate.connection.driver_class interbase.interclient.Driver# Hibernate.connection.url jdbc:interbase://localhost:3060/c:/firebird/test.gdb## Pure java# Hibernate.connection.driver_class Org.firebirdsql.jdbc.fbdriver#hibernate.connection.url Jdbc:firebirdsql:localhost/3050:/firebird/test.gdb## Pointbase#hibernate.dialect org.hibernate.dialect.pointbasedialect# Hibernate.connection.driver_class Com.pointbase.jdbc.jdbcuniversaldriver#hibernate.connection.url Jdbc:pointbase : Embedded:sample#hibernate.connection.username Pbpublic#hibernate.connection.password PBPUBLIC## Ingres## Older Versions (before ingress 2006) #hibernate. Dialect Org.hibernate.dialect.ingresdialect#hibernate.connection.driver_ Class Ca.edbc.jdbc.edbcdriver#hibernate.connection.url jdbc:edbc://localhost:ii7/database# Hibernate.connection.username User#hibernate.connection.password password## Ingres 2006 or Later#hibernate.dialect Org.hibernate.dialect.ingresdialect#hibernate.connection.driver_class com.ingres.jdbc.ingresdriver# Hibernate.connection.url jdbc:ingres://localhost:ii7/database; Cursor=readonly;auto=multi#hibernate.connection.username User#hibernate.connection.password password## Mimer SQL# Hibernate.dialect org.hibernate.dialect.mimersqldialect#hibernate.connection.Driver_class Com.mimer.jdbc.driver#hibernate.connection.url Jdbc:mimer:multi1#hibernate.connection.username Hibernate#hibernate.connection.password hibernate## InterSystems Cache#hibernate.dialect Org.hibernate.dialect.cache71dialect#hibernate.connection.driver_class com.intersys.jdbc.cachedriver# Hibernate.connection.username _system#hibernate.connection.password Sys#hibernate.connection.url jdbc:cache:// 127.0.0.1:1972/hibernate#################################### HIBERNATE Connection Pool ########################### ######## #hibernate. connection.pool_size 1############################## c3p0 Connection pool###################### ######## #hibernate. c3p0.max_size 2#hibernate.c3p0.min_size 2#hibernate.c3p0.timeout 5000#hibernate.c3p0.max_ Statements 100#hibernate.c3p0.idle_test_period 3000#hibernate.c3p0.acquire_increment 2#hibernate.c3p0.validate false################################# proxool Connection pool################################### Properties for External configuration of ProxooLhibernate.proxool.pool_alias pool1## only need one of the Following#hibernate.proxool.existing_pool true# Hibernate.proxool.xml proxool.xml#hibernate.proxool.properties proxool.properties############################### ##### Plugin ConnectionProvider ###################################### use a custom ConnectionProvider (if not set, Hiber Nate would choose a built-in connectionprovider using Hueristics) #hibernate. Connection.provider_class Org.hibernate.connection.drivermanagerconnectionprovider#hibernate.connection.provider_class Org.hibernate.connection.datasourceconnectionprovider#hibernate.connection.provider_class Org.hibernate.connection.c3p0connectionprovider#hibernate.connection.provider_class org.hibernate.connection.proxoolconnectionprovider########################## Transaction API ####################  ######## Enable automatic flush during the JTA beforecompletion () callback## (this setting was relevant with or without the Transaction API) #hibernate. Transaction.flush_before_completion## Enable Automatic session close at the end of transaction## (this setting was relevant with or without the TRANSACTI  On APIs) #hibernate. transaction.auto_close_session## The Transaction API abstracts application code from the underlying JTA or JDBC Transactions#hibernate.transaction.factory_class org.hibernate.transaction.jtatransactionfactory# Hibernate.transaction.factory_class org.hibernate.transaction.jdbctransactionfactory## to use Jtatransactionfactory, Hibernate must be able to locate the usertransaction in jndi## default is Java:comp/usertransaction # # You don't need this setting if you specify HIBERNATE.TRANSACTION.MANAGER_LOOKUP_CLASS#JTA. UserTransaction Jta/usertransaction#jta. UserTransaction Javax.transaction.usertransaction#jta. UserTransaction usertransaction## to use the Second-level cache with JTA, Hibernate must is able to obtain the JTA Transac Tionmanager#hibernate.transaction.manager_lookup_class org.hibernate.transaction.jbosstransactionmanagerlookup# Hibernate.tranSaction.manager_lookup_class org.hibernate.transaction.weblogictransactionmanagerlookup# Hibernate.transaction.manager_lookup_class org.hibernate.transaction.webspheretransactionmanagerlookup# Hibernate.transaction.manager_lookup_class org.hibernate.transaction.oriontransactionmanagerlookup# Hibernate.transaction.manager_lookup_class org.hibernate.transaction.resintransactionmanagerlookup############# #################### Miscellaneous Settings ################################### Print all generated SQL to the console# Hibernate.show_sql true## format SQL in log and Consolehibernate.format_sql true## add comments to the generated Sql#hiber Nate.use_sql_comments true## generate statistics#hibernate.generate_statistics true## Auto schema export# Hibernate.hbm2ddl.auto Create-drop#hibernate.hbm2ddl.auto Create#hibernate.hbm2ddl.auto update# Hibernate.hbm2ddl.auto validate## Specify a default schema and catalog for unqualified tablenames#hibernate.default_ Schema Test#hibernate.default_catalog Test# # Enable ordering of SQL UPDATEs by primary key#hibernate.order_updates true## set the maximum depth of the outer join FE TCH treehibernate.max_fetch_depth 1## Set the default batch size for batch Fetching#hibernate.default_batch_fetch_size 8# # rollback generated identifier values of deleted entities to default Values#hibernate.use_identifer_rollback true## enabl E Bytecode Reflection optimizer (disabled by default) #hibernate. Bytecode.use_reflection_optimizer true############### ######### jdbc Settings ########################## Specify a JDBC isolation level#hibernate.connection.isolation 4## Enable JDBC autocommit (not recommended!) #hibernate. Connection.autocommit true## Set the JDBC Fetch size#hibernate.jdbc.fetch_size 25## set the maximum JDBC 2 BATC H Size (a nonzero value enables batching) #hibernate. jdbc.batch_size 5#hibernate.jdbc.batch_size 0## enable batch updates E Ven for versioned Datahibernate.jdbc.batch_versioned_data true## enable use of JDBC 2 scrollable resultsets (specifying a dialect would cause Hibernate to use a sensible default) #hibernate. Jdbc.use_scrollable_resultset true## Use streams W Hen writing binary types to/from JDBChibernate.jdbc.use_streams_for_binary true## use JDBC 3 preparedstatement.getgenera Tedkeys () to get the identifier of an inserted Row#hibernate.jdbc.use_get_generated_keys false## choose a custom JDBC BATC her# hibernate.jdbc.factory_class## enable JDBC result set column alias caching # # (minor performance enhancement for Brok En JDBC drivers) # hibernate.jdbc.wrap_result_sets## Choose a custom SQL exception converter#hibernate.jdbc.sql_ exception_converter############################# second-level Cache ############################### optimize Chache For minimal "puts" instead of the minimal "gets" (good for Clustered cache) #hibernate. Cache.use_minimal_puts true## Set a pref IX for Cache region Nameshibernate.cache.region_prefix hibernate.test## disable the Second-level cache# Hibernate.cache.use_second_level_cache false## enable the Query Cache#hibernate.cache.use_query_cache true## Store the Second-level cache entries in a more human-friendly format#hibe Rnate.cache.use_structured_entries true## Choose a cache Implementation#hibernate.cache.provider_class Org.hibernate.cache.ehcacheprovider#hibernate.cache.provider_class Org.hibernate.cache.EmptyCacheProviderhibernate.cache.provider_class Org.hibernate.cache.HashtableCacheProvider #hibernate. Cache.provider_class Org.hibernate.cache.treecacheprovider#hibernate.cache.provider_class Org.hibernate.cache.oscacheprovider#hibernate.cache.provider_class org.hibernate.cache.swarmcacheprovider## Choose a custom query cache implementation#hibernate.cache.query_cache_factory############### JNDI ################# Specify a JNDI name for the Sessionfactory#hibernate.session_factory_name hibernate/session_factory## hibernate uses JNDI to bind a name to a sessionfactory and to look up the JTA usertransaction;## if hibernate.jndi.* is not specified, H Ibernate would use the default inItialcontext () which## is the best approach in an application Server#file system#hibernate.jndi.class Com.sun.jndi.fscont Ext. Reffscontextfactory#hibernate.jndi.url file:/#WebSphere #hibernate.jndi.class Com.ibm.websphere.naming.wsninitialcontextfactory#hibernate.jndi.url iiop://localhost:900/

Move Sticker: http://beckham-xiao.iteye.com/blog/355476

Configure various database links in Hibernate configuration files

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.