Hi Marc
Marc Santhoff schrieb:
Hi Peter,
Am Freitag, den 30.09.2005, 10:33 +0200 schrieb Peter Eberlein:
Just a little reminder...
the following snippet doesn't work, are ther any additional driver
properties required?
Can somebody with an oracle-connection check this?
mDBProperties(0).Name = "User"
mDBProperties(0).Value = "Me"
mDBProperties(1).Name = "Password"
mDBProperties(1).Value = "secret"
oDriver = createUNOService("com.sun.star.sdbc.DriverManager")
sDatabaseURL = "jdbc:oracle:thin:@//IPAddress:1521/DBName"
oConnect = oDriver.getConnectionWithInfo(sDatabaseURL,mDBProperties())
According to the Developers Guide (I never tried this) you are missing
something:
Read the part "The SDBC Driver for JDBC" in the database chapter and you'll see
that this driver needs another property set:
I did, the following is only one of two possibilities using the
DriverManager (I prefered the first one, so the DriverManager has by
means of the URL to decide which driver has to be used).
<snip>
// first create the needed url
String url = "jdbc:mysql://localhost:3306/TestTables";
// second create the necessary properties
com.sun.star.beans.PropertyValue [] props = new
com.sun.star.beans.PropertyValue[] {
new com.sun.star.beans.PropertyValue("user", 0, "test1",
com.sun.star.beans.PropertyState.DIRECT_VALUE),
new com.sun.star.beans.PropertyValue("password", 0, "test1",
com.sun.star.beans.PropertyState.DIRECT_VALUE),
new com.sun.star.beans.PropertyValue("JavaDriverClass", 0,
"org.gjt.mm.mysql.Driver",
com.sun.star.beans.PropertyState.DIRECT_VALUE)
};
// now create a connection to adabas
^^^^^^ copy-typo in the SDK
xConnection = xDriverManager.getConnectionWithInfo(url, props);
</snip>
I think if you fill in the "JavaDriverClass" prop chances are good ...
Sorry, no, I tried it before.
There's an exception (translated: "invalid arguments by invoking"), when
using "oracle.jdbc.driver.OracleDriver" as JavaDriverClass, irrespective
of the mode of using the DriverManager.
I also tried the property "IsPasswordRequired" without success.
HTH,
Marc
Regards
Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]