| Re: database access using JAVA or COM [message #49770 is a reply to message #49765] |
Mon, 14 August 2006 16:45   |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
Rick Towler wrote:
> Has anyone made any database connectivity tools publicly available? I
> know that Mike Wallace has done a lot of work with the IDL-Java bridge
> and JDBC but I don't think he has released anything. I have worked with
> the ADODB COM object and plan to experiment with it in IDL this
> afternoon but ideally someone will have already done this :)
An update:
IDLcomIDispatch seems to still suffer from partialimplementationitus.
Certain methods work and certain properties are accessible, but other
properties and methods don't work and fail with unspecified errors.
cstring='Provider=OraOLEDB.Oracle;Data Source=somedb;User ' + $
'Id=user;Password=pass'
db = OBJ_NEW('IDLcomIDispatch$PROGID$ADODB_Connection')
db -> SetProperty, ConnectionString=cstring
db -> Open
db -> GetProperty, Provider=p, State=s
print, p
OraOLEDB.Oracle.1
print, s
1
So far so good. I was thinking I was home free...
rs = OBJ_NEW('IDLcomIDispatch$PROGID$ADODB_RecordSet')
sql = 'Select * from ship'
rs -> Open, sql, db
% IDLCOMIDISPATCH$PROGID$ADODB_RECORDSET::OPEN: Unable to call method OPEN.
<unknown system error>
Humm. Here's the interface definition:
[id(0x000003fe), helpcontext(0x0012c8d7)]
void Open(
[in, optional] VARIANT Source,
[in, optional] VARIANT ActiveConnection,
[in, optional, defaultvalue(-1)] CursorTypeEnum CursorType,
[in, optional, defaultvalue(-1)] LockTypeEnum LockType,
[in, optional, defaultvalue(-1)] long Options);
O.K. How about something simpler:
rs -> GetProperty, Status=s
% IDLCOMIDISPATCH$PROGID$ADODB_RECORDSET::GETPROPERTY: Unable to access
property STATUS.
<unknown system error>
The interface definition:
[id(0x00000405), propget, helpcontext(0x0012c949)]
long Status();
Doesn't get much simpler than that.
After writing a couple of wildly successful functions using COM+ADODB in
MATLAB, I am left a bit underwhelmed with IDL's poor support for COM.
I've been waiting for a working implementation of IDLcomIDispatch ever
since it's release in 5.5. I must be the only one... :(
-Rick
|
|
|
|