Use the Hibernate framework to generate executable SQL statements for hql-Oracle Dialect
Introduction: Why is this requirement derived from the company's project requirements? The company's project uses java's struts2 + spring2.5 + oracle middleware tuxedo. The database uses Oracle, but because it does not directly connect to the database, the middleware processing method does not require too many services, so the network began to look for data encoding. It took about more than a week to complete this task. Now we have sorted out and shared it with you, and we have also sorted out our own knowledge. 1. to import the relevant jar package: [In alphabetical order] antlr-2.7.5H3.jar language converter, Hibernate uses it to convert HQL to SQL asm. jar ASM byte conversion library cglib-2.1.2.jar efficient code generation tools, Hibernate uses it at runtime to expand Java class and implement Java interface classes12.jar Oracle Database driver commons-collections-2.1.1.jar Apache tool set, used to enhance the Java processing capabilities of the collection commons-logging-1.0.4.jar Apache Software fund provided by the log tool dom4j-1.6.1.jar dom4j XML Parser hibernate. jar Hibernate core library jta. jar standard JAVA transaction processing interface 2. add hibernate to the src project. cfg. x Ml, and configure the database dialect, and ing the object ing file. You do not need to configure other attributes because it is not required. Note: Do not add the database connection url because after the database is added, the program will try to connect. Copy code 1 <? Xml version = '1. 0' encoding = 'utf-8'?> 2 <! DOCTYPE hibernate-configuration PUBLIC 3 "-// Hibernate/Hibernate Configuration DTD 3.0 // EN" 4 "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> 5 6 <! -- Generated by MyEclipse Hibernate Tools. --> 7