-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Connect to DB2
PostPosted: Mon Aug 17, 2009 1:34 am 
Beginner
Beginner

Joined: Sat Dec 09, 2006 12:02 pm
Posts: 26
I use DB2 and C# with Visual Studio 2008 and .NET 3.5 SP1. I want to connect to my DB2 Server via NHibernate, but the connection string seems to be wrong. Has anybody worked with it? I also tried to connect via another program (MyGenerate) and the same error occured (Provider not registered). Here are my configuration data. Is OleDB right? With ODBC i can't connect too.

<property name="connection.provider">NHibernate.Connection.D riverConnectionProvider</property>
<property name="connection.driver_class">NHibernate.Driver.O leDbDriver</property>
<property name="connection.connection_string">provider=IBM.D ata.DB2;provider connection string="Database=DBTEST;uid=MWareDBUser;Server=FIL ESERVER:50000;pw=mypw"</property>
<property name="show_sql">true</property>
<property name="dialect">NHibernate.Dialect.DB2Dialect</property>

By the way. I have installed the IBM DB" Serve Driver Pack (v9.5fp4_nt32_dsdriver_DE.exe). I run Windows 7 (64 Bit), but the 64 Bit version of this file is not working, so i have installed the 32 Bit version. But when i use the Entity Framework of Microsoft, i can connect to my db ia the DB2 Provider. But what do i have to set in this xml file???

Good night
Nic


Top
 Profile  
 
 Post subject: Re: Connect to DB2
PostPosted: Mon Aug 17, 2009 4:51 am 
Beginner
Beginner

Joined: Sat Dec 09, 2006 12:02 pm
Posts: 26
I solved it by my own. you have to set the driver_class do DB2Driber, and in the connection string there shouldn't be a provider. and the IBM.Data.DB2.dll MUST be in the folder of your app...


Top
 Profile  
 
 Post subject: Re: Connect to DB2
PostPosted: Mon Aug 17, 2009 7:34 am 
Beginner
Beginner

Joined: Sat Dec 09, 2006 12:02 pm
Posts: 26
And you have to set the target CPU Type to x86, because the 64 bit IBM Server provider is not working...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.