In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
What this article shares to you is about the connection of different Hibernate databases and what the SQL dialect is like. The editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
The following code shows the connections between different databases in Hibernate.
< !--MySql 驱动程序 eg. mysql-connector-java-5.0.4-bin.jar--> < property name="dialect">Org.hibernate.dialect.MySQLDialect
< /property> < property name="connection.driver_class">Com.mysql.jdbc.Driver
< /property> < !-- JDBC URL --> < property name="connection.url">Jdbc:mysql://localhost/dbname?characterEncoding=gb2312
< /property> < !-- 数据库用户名--> < property name="connection.username">Root
< /property> < !-- 数据库密码--> < property name="connection.password">Root
< /property> < !--Sql Server 驱动程序 eg. jtds-1.2.jar--> < property name="dialect">Org.hibernate.dialect.SQLServerDialect
< /property> < property name="connection.driver_class">Net.sourceforge.jtds.jdbc.Driver
< /property> < !-- JDBC URL --> < property name="connection.url">Jdbc:jtds:sqlserver://localhost:1433;DatabaseName=dbname
< /property> < !-- 数据库用户名--> < property name="connection.username">Sa
< /property> < !-- 数据库密码--> < property name="connection.password"> < /property> < !--Oracle 驱动程序 ojdbc14.jar--> < property name="dialect">Org.hibernate.dialect.OracleDialect
< /property> < property name="connection.driver_class">Oracle.jdbc.driver.OracleDriver
< /property> < !-- JDBC URL --> < property name="connection.url">Jdbc:oracle:thin:@localhost:1521:dbname
< /property> < !-- 数据库用户名--> < property name="connection.username">Test
< /property> < !-- 数据库密码--> < property name="connection.password">Test
< /property>If the following error occurs, it may be that the Hibernate SQL dialect (hibernate.dialect) setting is incorrect.
Caused by: java.sql.SQLException: [Microsoft] [SQLServer 2000 Driver for JDBC] [SQLServer] 'last_insert_id' is not a recognized function name.
RDBMS dialect DB2org.hibernate.dialect.DB2DialectDB2 AS/400org.hibernate.dialect.DB2400DialectDB2 OS390org.hibernate.dialect.DB2390DialectPostgreSQLorg.hibernate.dialect.PostgreSQLDialectMySQLorg.hibernate.dialect.MySQLDialectMySQL with InnoDBorg.hibernate.dialect.MySQLInnoDBDialectMySQL with MyISAMorg.hibernate.dialect.MySQLMyISAMDialectOracle (any version) org.hibernate.dialect.OracleDialectOracle 9i/10gorg.hibernate.dialect.Oracle9DialectSybaseorg.hibernate.dialect.SybaseDialectSybase Anywhereorg.hibernate.dialect.SybaseAnywhereDialectMicrosoft SQL Serverorg.hibernate.dialect.SQLServerDialectSAP DBorg.hibernate.dialect.SAPDBDialectInformixorg.hibernate.dialect.InformixDialectHypersonicSQLorg.hibernate.dialect.HSQLDialectIngresorg.hibernate.dialect.IngresDialectProgressorg .hibernate.dialect.ProgressDialectMckoi SQLorg.hibernate.dialect.MckoiDialectInterbaseorg.hibernate.dialect.InterbaseDialectPointbaseorg.hibernate.dialect.PointbaseDialectFrontBaseorg.hibernate.dialect.FrontbaseDialectFirebirdorg.hibernate.dialect.FirebirdDialect above is the connection of Hibernate different databases and what the SQL dialect is like. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.