Please post this message to the NHUSERS forum (
http://groups.google.com/group/nhusers).  This discussion list is for the
development of the NHibernate project, rather than the use of the project
itself.

Steve Bohlen
[email protected]
http://blog.unhandled-exceptions.com
http://twitter.com/sbohlen


On Wed, Aug 31, 2011 at 1:01 PM, DBLWizard <[email protected]> wrote:

> Howdy,
>
> I am trying to get DB2 zOS 9 to work with NHibernate but I can not
> find clear documenation on how to setup the app.config and the
> hibernate.cfg.xml file.  I'm getting an error when its trying to build
> the SQL statements a substituting parameters.  So I want to make sure
> I've got my config file setup.  I have tried both of these to
> configurations and both get the same error.
>
> <?xml version="1.0" encoding="utf-8" ?>
> <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
>  <session-factory name="Test">
>    <property
> name="connection.provider">NHibernate.Connection.DriverConnectionProvider</
> property>
>    <property name="dialect">NHibernate.Dialect.DB2Dialect</property>
>    <property
> name="connection.driver_class">NHibernate.Driver.DB2Driver</property>
>    <property
> name="connection.connection_string">Database=dbalias;Uid=myUid;
> Pwd=myPass</property>
>    <property name="show_sql">true</property>
>  </session-factory>
> </hibernate-configuration>
>
> This is an ODBC example I found:
>
> <?xml version="1.0" encoding="utf-8" ?>
> <hibernate-configuration xmlns="urn:nhibernate-configuration-2.0" >
>    <session-factory name="session">
>        <property
> name="connection.provider">NHibernate.Connection.DriverConnectionProvider</
> property>
>        <property
> name="connection.driver_class">NHibernate.Driver.OdbcDriver</property>
>        <property name="connection.connection_string">driver={IBM DB2
> ODBC DRIVER};Database=db;hostname=host;port=port;protocol=TCPIP;
> uid=uid; pwd=pwd</property>
>        <property name="show_sql">true</property>
>        <property name="dialect">NHibernate.Dialect.DB2Dialect</
> property>
>    </session-factory>
> </hibernate-configuration>
>
> As I said I've tried both of these and get the same error and it
> revolves around the false return of the UseNamedPrefixInSql function.
> The Error I'm getting is:
>
> could not load an entity: [ADRPData.Domain.DocType#ArbAssocRuling]
> [SQL: SELECT doctype0_.SDOCTYPEID as SDOCTYPEID1_0_,
> doctype0_.SDOCTYPECODE as SDOCTYPE2_1_0_ FROM DocType doctype0_ WHERE
> doctype0_.SDOCTYPEID=?]
>
> Can anybody point me to a good resource for using NHibernate with DB2
> zOS UDB or how this config file should be set to make things work
> correctly.
>
> thanks
>
> dbl

Reply via email to