[JDEV] XDB / ODBC

Michel Oosterbeek oosterbeek.mah at stu.hsbrabant.nl
Fri Feb 22 09:00:51 CST 2002


Hi Raditha,

>> SQLFreeHandle(SQL_HANDLE_DBC,self->dbc)  in xdbodbc_connect ?

I checked this by putting some debug info with every occurance of
SQLFreeHandle, but this didn't seem to be the case. At first the
environment-handler is made successfully, then the database-handler is
created, also OK, then the connection is made, still everything all right...
(all three times SQL_SUCCESS) but when we get to  " xdbodbc_is_connected
(XdbODBCBackend *self) "  which is called by xdbodbc_connect, the error
occurs.

I found out the line
ret = SQLGetInfo(self->dbc,SQL_DATA_SOURCE_NAME, buffer,sizeof
buffer,&outlen);
is returning SQL_INVALID_HANDLE.


>> BTW: what's your database?

The database I am using is DB2, with unixODBC-2.0.9 (without threads) on
RedHat 7.2

Thanks,

Michel Oosterbeek.


-=Debug Output =-     (still the same)

Thu Feb 21 13:07:25 2002  xdb.c:41 xdb_results checking xdb packet <xdb
type='result' to='xdb' from='config at -internal' ns='jabberd:xdb_sql:config'
id='0'><xdb_sql xmlns='jabberd:xdb_sql:config'>
    <backend>odbc</backend>
    <connection>
      <host>dbpc</host>
      <db>testdb</db>
      <user>testuser</user>
      <pass>testpw</pass>
    </connection>

    <queries>
      <querydef name='auth-get'>
        <text>
          SELECT password FROM users WHERE username =
&apos;$$username$$&apos;
        </text>

        <bindvar name='user'>$$username$$</bindvar>

        <bindcol name='password' offset='0'/>
      </querydef>

      <querydef name='auth-set'>
        <text>
          UPDATE users SET password = &apos;$$p$$&apos; WHERE username =
&apos;$$username$$&apos;
        </text>
        <bindvar name='user'>$$username$$</bindvar>
        <bindvar name='password'>$$p$$</bindvar>
      </querydef>

    <querydef name
Thu Feb 21 13:07:25 2002  log.c:105 <log type='alert'
from='-internal'>[xdbsql_config_init] cannot connect database :
</log>
Thu Feb 21 13:07:25 2002  log.c:105 <log type='alert'
from='-internal'>[xdb_sql] configuration failed</log>
Thu Feb 21 13:07:25 2002  deliver.c:277 Registering c2s with instance c2s
Thu Feb 21 13:07:25 2002  client.c:440 pthsock_client loading
Thu Feb 21 13:07:25 2002  deliver.c:235 @-internal processing <xdb
type='get' to='config at -internal' from='c2s' ns='jabber:config:pth-csock'
id='0'/>
Thu Feb 21 13:07:25 2002  deliver.c:649 delivering to instance 'c2s'

................

Thu Feb 21 13:07:25 2002  mio.c:1115 io_select to listen on 5269 [(null)]
Thu Feb 21 13:07:25 2002  dnsrv.c:132 DNSRV CHILD: starting
Thu Feb 21 13:07:25 2002  mio.c:1139 io_select starting to listen on 5269
[(null)]Thu Feb 21 13:07:25 2002  dnsrv.c:147 DNSRV CHILD: Read from buffer:
<stream>

Thu Feb 21 13:07:25 2002  deliver.c:460 DELIVER 3:-internal <log
type='alert' from='-internal'>[xdbsql_config_init] cannot connect database :
</log>
Thu Feb 21 13:07:25 2002  deliver.c:649 delivering to instance 'elogger'
20020221T12:07:25: [alert] (-internal): [xdbsql_config_init] cannot connect
database :

Thu Feb 21 13:07:25 2002  deliver.c:460 DELIVER 3:-internal <log
type='alert' from='-internal'>[xdb_sql] configuration failed</log>
Thu Feb 21 13:07:25 2002  deliver.c:649 delivering to instance 'elogger'
20020221T12:07:25: [alert] (-internal): [xdb_sql] configuration failed
Thu Feb 21 13:07:25 2002  mio.c:624 socket 9 has restore karma -100 -=> 50





More information about the JDev mailing list