Use the Hibernate framework to generate executable SQL statements for hql-Oracle Dialect

Source: Internet
Author: User
Tags xml parser

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

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.