[Mono-dev] IBM.Data.DB2.DB2Exception: Unable to allocate statement handle

Carlos Ruiz Diaz carlos.ruizdiaz at gmail.com
Thu Feb 12 10:46:11 EST 2009


After failing trying to connect with the native driver I switched to
unixODBC and it works fine for me. It is stable and I currently have a large
program using ODBC as its connector.
I use openSuse as my major OS. I installed the db2 express C but I was
unable to find the required library to make IBM.DB2 dll to work. Bad for me.




On Thu, Feb 12, 2009 at 4:20 AM, Bartolomeo Nicolotti
<bnicolotti at siapcn.it>wrote:

>
> I'd like to use the webservice "As is" so that we can switch easyly...
>
> if I won't be able to do it with IBM.Data.DB2 in a few days I'll consider
> using other way to connect.
>
> Do you know if with these providers you can connecto to AS/400?
>
> Many thanks
>
> Best regards
>
>
>
> Bartolomeo Nicolotti wrote:
> >
> > Da:   Daniel Morgan <monodanmorg at yahoo.com>
> >
> > Have you considered using ODBC provider instead?
> >
> > System.Data.Odbc namespace is included in System.Data assembly.
> >
> > You can use iodbc or unixodbc on linux.  There's commercial odbc
> solutions
> > for linux too.
> >
> > http://mono-project.com/ODBC
> >
> > http://www.unixodbc.com/doc/db2.html
> >
> > Novell maintains System.Data.Odbc; however, I do not think anyone is
> > maintaining IBM.Data.DB2 in Mono.
> >
> >
> > --- On Wed, 2/11/09, Bartolomeo Nicolotti <bnicolotti at siapcn.it> wrote:
> >
> >
> >
> > Bartolomeo Nicolotti wrote:
> >>
> >> IBM.Data.DB2.DB2Exception: Unable to allocate statement handle
> >>
> >> by Bartolomeo Nicolotti :: Rate this Message:
> >>
> >> Reply | Reply to Author | View Threaded | Show Only this Message
> >> Hello,
> >>
> >> I've installed mono, and xsp (not yet mod_mono) on ubuntu following the
> >> instruction here:
> >>
> >> http://ubuntuforums.org/showthread.php?t=803743
> >>
> >> in view of using mod_mono together with php on ubuntu server 8.04, to
> >> migrate a web service that access a db2/as400 database.
> >>
> >> I've also installed db2exc from ubuntu repository as said here:
> >>
> >> http://www.ubuntu.com/partners/ibm/db2
> >>
> >> I can compile a test program that does a query to the db:
> >>
> >>  http://www.nabble.com/file/p21953488/helloDB2.cs helloDB2.cs
> >>
> >> siap at LxPC54:~/src/test$ gmcs -r:/usr/lib/mono/1.0/IBM.Data.DB2.dll
> >> -r:/usr/lib/mono/2.0/System.Data.dll helloDB2.cs
> >>
> >> but when I execute it:
> >>
> >> siap at LxPC54:~/src/test$ sudo MONO_LOG_LEVEL=debug mono helloDB2.exe
> bart
> >>
> >> ....
> >>
> >> Mono-INFO: Assembly Ref addref System.Data 0x8362e10 -> System.Xml
> >> 0x83719d8: 2
> >>
> >> Hello, bart
> >> Mono-INFO: DllImport attempting to load: 'libdb2'.
> >> Mono-INFO: DllImport loading location: 'libdb2.so'.
> >> Mono-INFO: Searching for 'SQLAllocHandle'.
> >> Mono-INFO: Probing 'SQLAllocHandle'.
> >> Mono-INFO: Found as 'SQLAllocHandle'.
> >> Mono-INFO: DllImport attempting to load: 'libdb2'.
> >> Mono-INFO: DllImport loading location: 'libdb2.so'.
> >> Mono-INFO: Searching for 'SQLAllocHandle'.
> >> Mono-INFO: Probing 'SQLAllocHandle'.
> >> Mono-INFO: Found as 'SQLAllocHandle'.
> >> Bart
> >> not useLibCli
> >> Bart
> >> not useLibCli
> >> Mono-INFO: DllImport attempting to load: 'libdb2'.
> >> Mono-INFO: DllImport loading location: 'libdb2.so'.
> >> Mono-INFO: Searching for 'SQLDriverConnectW'.
> >> Mono-INFO: Probing 'SQLDriverConnectWW'.
> >> Mono-INFO: Probing 'SQLDriverConnectWW'.
> >> Mono-INFO: Probing 'SQLDriverConnectW'.
> >> Mono-INFO: Found as 'SQLDriverConnectW'.
> >> Mono-INFO: DllImport attempting to load: 'libdb2'.
> >> Mono-INFO: DllImport loading location: 'libdb2.so'.
> >> Mono-INFO: Searching for 'SQLDriverConnectW'.
> >> Mono-INFO: Probing 'SQLDriverConnectWW'.
> >> Mono-INFO: Probing 'SQLDriverConnectWW'.
> >> Mono-INFO: Probing 'SQLDriverConnectW'.
> >> Mono-INFO: Found as 'SQLDriverConnectW'.
> >> Mono-INFO: DllImport attempting to load: 'libdb2'.
> >> Mono-INFO: DllImport loading location: 'libdb2.so'.
> >> Mono-INFO: Searching for 'SQLGetInfoW'.
> >> Mono-INFO: Probing 'SQLGetInfoWW'.
> >> Mono-INFO: Probing 'SQLGetInfoWW'.
> >> Mono-INFO: Probing 'SQLGetInfoW'.
> >> Mono-INFO: Found as 'SQLGetInfoW'.
> >> Mono-INFO: DllImport attempting to load: 'libdb2'.
> >> Mono-INFO: DllImport loading location: 'libdb2.so'.
> >> Mono-INFO: Searching for 'SQLGetInfoW'.
> >> Mono-INFO: Probing 'SQLGetInfoWW'.
> >> Mono-INFO: Probing 'SQLGetInfoWW'.
> >> Mono-INFO: Probing 'SQLGetInfoW'.
> >> Mono-INFO: Found as 'SQLGetInfoW'.
> >> Mono-INFO: DllImport attempting to load: 'libdb2'.
> >> Mono-INFO: DllImport loading location: 'libdb2.so'.
> >> Mono-INFO: Searching for 'SQLGetDiagRec'.
> >> Mono-INFO: Probing 'SQLGetDiagRec'.
> >> Mono-INFO: Found as 'SQLGetDiagRec'.
> >> Mono-INFO: DllImport attempting to load: 'libdb2'.
> >> Mono-INFO: DllImport loading location: 'libdb2.so'.
> >> Mono-INFO: Searching for 'SQLGetDiagRec'.
> >> Mono-INFO: Probing 'SQLGetDiagRec'.
> >> Mono-INFO: Found as 'SQLGetDiagRec'.
> >> Bart
> >> not useLibCli
> >>
> >> Unhandled Exception: IBM.Data.DB2.DB2Exception: ERROR [08003] [IBM][CLI
> >> Driver] CLI0106E  Connection is closed. SQLSTATE=08003
> >> InternalExecuteNonQuery: Unable to allocate statement handle.
> >>   at IBM.Data.DB2.DB2Command.AllocateStatement (System.String location)
> >> [0x00000]
> >>   at IBM.Data.DB2.DB2Command.ExecuteNonQueryInternal (CommandBehavior
> >> behavior) [0x00000]
> >>   at IBM.Data.DB2.DB2Command.ExecuteReader (CommandBehavior behavior)
> >> [0x00000]
> >>   at IBM.Data.DB2.DB2Command.ExecuteReader () [0x00000]
> >>   at (wrapper remoting-invoke-with-check)
> >> IBM.Data.DB2.DB2Command:ExecuteReader ()
> >>   at HelloWorldDb2.Main (System.String[] args) [0x00000]
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/IBM.Data.DB2.DB2Exception%3A-Unable-to-allocate-statement-handle-tp21953488p21971698.html
> Sent from the Mono - Dev mailing list archive at Nabble.com.
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090212/cb26e0b0/attachment-0001.html 


More information about the Mono-devel-list mailing list