A very strange problem was just encountered because of incorrect Hibernate SQL dialect configuration. It took some time to find out the problem.
This exception is difficult to arrange, because no exception information is thrown in the background, and the information printed in the background is normal!
Entity class:
Package net. yeah. fancydeepin. po;
Import javax. persistence. Column;Import javax. persiste
If the following error occurs, it may be that the hibernate SQL dialect (hibernate. dialect) is incorrectly set.Caused by: Java. SQL. sqlexception: [Microsoft] [sqlserver 2000 driver for JDBC] [sqlserver] 'last _ insert_id 'is not a recognizable function name.
H
());
Registerhibernatetype (Types.binary,hibernate.string.getname ());
Registerhibernatetype ( -1, Hibernate.STRING.getName ());
After the Hibernate3 configuration Registerhibernatetype (Types.decimal, New Bigdecimaltype (). GetName ());
Registerhibernatetype (Types.longvarchar,new StringType (). GetName ()); Registerhibernatetype (Types.binary,new StrinGtype (). GetName ());
Registerhibernatetype ( -1, New StringType (). GetName ());
}
}
Description: If your database is MySQL, and use the d
Org.hibernate.dialect.SybaseAnywhereDialect
Microsoft SQL Server 2000
Org.hibernate.dialect.SQLServerDialect
Microsoft SQL Server 2005
Org.hibernate.dialect.SQLServer2005Dialect
Microsoft SQL Server 2008
Org.hibernate.dialect.SQLServer2008Dialect
SAP DB
Org.hibernate.dialect.SAPDBDialect
Informix
Org.hibernate.dialect.InformixDialect
Hypersonicsql
Org.hibernate.dialect.HSQLDial
Tags: des blog http io ar os using SP forHibernate SQL dialect (hibernate.dialect) spring configuration file applicationcontext.xml Hibernate SQL dialect (hibernate.dialect)
Database
Hibernate dialect
DB2
Org.hibernate.dialect.DB2Dialect
;org.hibernate.dialect.MySQLInnoDBDialectlater I thought maybe is version compatibility question, the book says is uses Hibernate3 I use is hibernate4. Okay, I'll just re-download the Hibernate3 or useless ... In this way, two days down, what all kinds of ways have tried, or reported the same mistakefinally really can not, see the next Hibernate video tutorial, step by step follow, every detail is not spared, try Hibernate.cfg.xml and **.hbm.xml each
For the database property hibernate. the correct Org. hibernate. dialect. dialect subclass. if you specify a dialect, Hibernate uses reasonable default values for some of the attributes listed above, saving you the effort to manua
org.hibernate.dialect.SQLServerDialect
Microsoft SQL Server 2005
org.hibernate.dialect.SQLServer2005Dialect
Microsoft SQL Server 2008
org.hibernate.dialect.SQLServer2008Dialect
SAP DB
org.hibernate.dialect.SAPDBDialect
Informix
org.hibernate.dialect.InformixDialect
Hypersonicsql
org.hibernate.dialect.HSQLDialect
H2 Database
org.hibernate.dialect.H2Dialect
I
In the development of hibernate programs, the need for sessionfactory configuration, simply, that is, to establish a connection with the database configuration, in the Hibernate general use of XML files to configure, However, in the configuration of the file, you need to set the dialect dialect attribute value, for dif
hibernate is not supported for the text data type of the database.Hibernate is good when using the HQL query to include the text Type field. If you use native SQL, which is when querying the text type using the Createsqlquery method, you always get an error:Org.hibernate.MappingException:No dialect mapping for JDBC type:-1Atorg.hibernate.dialect.TypeNames.get (typenames.java:56)There was a problem with the
Customizing a dialect class--hibernate dialectTags: hibernatesqlserverjdbcmysql database java2012-07-04 18:46 2847 people read Comments (1) favorite reports Classification:Hibernate (+)The class needs to inherit the dialect class corresponding to the database we are using. For example: If we are using MySQL (version 5.x.x), we need to inherit "Org.hibernate".
Dialect is "dialect" because hibernate is about translating Java objects into relational databases, while relational databases have some uniform standards, such as SQL-92, but virtually every database, such as Oracle, MySQL, MS SQL Server, etc. in order to improve performance or add functionality, some additional standards or syntax are provided, so
Org.hibernate.dialect.Oracle10gDialect
Sybase
Org.hibernate.dialect.SybaseASE15Dialect
Sybase Anywhere
Org.hibernate.dialect.SybaseAnywhereDialect
Microsoft SQL Server 2000
Org.hibernate.dialect.SQLServerDialect
Microsoft SQL Server 2005
Org.hibernate.dialect.SQLServer2005Dialect
Microsoft SQL Server 2008
Org.hibernate.dialect.SQLServer2008Dialect
SAP DB
Org.hibernate.dia
Org.hibernate.dialect.ProgressDialect
Mckoi SQL
Org.hibernate.dialect.MckoiDialect
Interbase
Org.hibernate.dialect.InterbaseDialect
Pointbase
Org.hibernate.dialect.PointbaseDialect
Frontbase
Org.hibernate.dialect.FrontbaseDialect
Firebird
Org.hibernate.dialect.FirebirdDialect
In the development of Hibernate program, need to do sessionfactory configuration,
Error code:
Org. hibernate. mappingexception: No dialect mapping for JDBC Type:-1
Solution: 1
Org. hibernate. mappingexception: No dialect mapping for JDBC Type:-1 exception because hibernate does not support the text type in the database, that is,
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.