hibernate 中文参数乱码

hibernate 中文参数乱码hibernate里在sql语句中使用中文参数乱码的解决方案如下:
<prop key="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</prop>
<!-- 配置sessionFactory, 注意这里引入的包的不同  -->
    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
        <property name="dataSource">
            <ref local="dataSource" />
        </property>
        <property name="mappingResources">
            <list>
                <value>com/ihandy/airwap/beans/Hotflight.hbm.xml</value>
                <value>com/ihandy/airwap/beans/Area.hbm.xml</value>
                <value>com/ihandy/airwap/beans/AirAssociatorInfo.hbm.xml</value>
                <value>com/ihandy/airwap/beans/OrderDetail.hbm.xml</value>
                <value>com/ihandy/airwap/beans/OrderQuest.hbm.xml</value>
            </list>
        </property>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
                <prop key="hibernate.show_sql">true</prop>
                <prop key="hibernate.c3p0.minPoolSize">2</prop>
                <prop key="hibernate.c3p0.maxPoolSize">5</prop>
                <prop key="hibernate.c3p0.timeout">600</prop>
                <prop key="hibernate.c3p0.max_statement">200</prop>
                <prop key="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</prop>
            </props>
        </property>
    </bean>

你可能感兴趣的:(sql,bean,xml,Hibernate,orm)