Page 1 of 1
jdbc connection for Oracle RAC database
Posted: Tue Oct 19, 2010 3:46 pm
by mbastarache
Hi,
I would like to configure a jdbc connection to access an Oracle RAC database.
Actually my jdbc connection has this format:
jdbc:oracle:thin@server:port:sid
I have no problem to connect to the database this way.
I try to change this for:
jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)
(ADDRESS=(PROTOCOL=TCP)(HOST=host1) (PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=host2) (PORT=1521))
(CONNECT_DATA=(SERVICE_NAME=service)))
But with this format I have an error when use the button Test Connection:
Invald Oracle Url specify
SQL Status: 99999
Error code: 17067
Invalid Oracle URL specified
Is it possible to configure a jdbc connection to point to Oracle RAC database or it is not supported with OpenOffice?
Thanks!
Re: jdbc connection for Oracle RAC database
Posted: Tue Oct 19, 2010 4:33 pm
by r4zoli
OOo support only one database connection, you tried to reach two host, I suppose.
Re: jdbc connection for Oracle RAC database
Posted: Tue Oct 19, 2010 4:42 pm
by mbastarache
I'm not trying to reach 2 host at the same time.
The thing I try to do is called client-side load balancing and I know that this a supported for jdbc connection. This is the way to proceed to connect to a RAC database. I already configured this a lot of time but never with OpenOffice.
Re: jdbc connection for Oracle RAC database
Posted: Tue Oct 19, 2010 4:47 pm
by r4zoli
I think it is not supported, you can get exact information from developers on dba users mailing list: user at dba dot openoffice dot org
Re: jdbc connection for Oracle RAC database
Posted: Tue Oct 19, 2010 6:55 pm
by rudolfo
mbastarache wrote:I'm not trying to reach 2 host at the same time.
The thing I try to do is called client-side load balancing and I know that this a supported for jdbc connection. This is the way to proceed to connect to a RAC database. I already configured this a lot of time but never with OpenOffice.
Looking at the connect descriptor that your use:
(ADDRESS=(PROTOCOL=TCP)(HOST=host1) (PORT=1521))
this reminds me very much of Oracle's SQL*Net tnsnames syntax. Are you sure you were using the
thin jdbc driver when you did this before? As far as I understood this the thick driver requires a Oracle client installation (at least sql*net or whatever they call it now) is required and it uses the SQL*Net layer for the communication with the database. Load balancing happens on the SQL*Net layer and is transparent for the jdbc layer.
But maybe you need to follow r4zoli's advice and ask the dev's. But better you provide then your Oracle jdbc version, that you are using, as well.
Re: jdbc connection for Oracle RAC database
Posted: Tue Oct 19, 2010 7:46 pm
by mbastarache
Yes I'm sure that I use the jdbc thin driver and with this driver you don't need to install any oracle client. The JDBC thin driver I use is ojdbc5.jar .
I already posted a message on the mailing list
users@dba.openoffice.org. Hope I will have an answer....
Thanks
Re: jdbc connection for Oracle RAC database
Posted: Wed Oct 20, 2010 2:02 am
by rudolfo
Can we recall what JDBC means! That's a common API layer for any kind of databases. The application layer (OpenOffice or your other java applications) just don't cares about implementation details of the connection to the database engine. That's the job of the driver. So the best answer that you will get from the OOo developers is: OOo Base supports
JDBC 3.x or JDBC 4.0 or ... maybe with some limitations that they hopefully also mention. Period.
If you want to use JDBC driver X you have to figure out from the driver documentation which JDBC version is supported and how completely.
That's the whole point about standards. During development you don't have to test with hundreds of drivers but you just build you app that it follows the specs.
Re: jdbc connection for Oracle RAC database
Posted: Wed Oct 20, 2010 7:36 pm
by mbastarache
Just to let you know that I finally successfully configure my jdbc connection to a RAC database.
From the database wizard you have to configure a jdbc connection and in the Datasource Url you have to enter this:
oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)(ADDRESS=(PROTOCOL=TCP)(HOST=server1)(PORT=1551))(ADDRESS=(PROTOCOL=TCP)(HOST=server2)(PORT=1551))(CONNECT_DATA=(SERVICE_NAME=service)))
The jdbc thin driver I used is correct.
Thank you all.
Re: jdbc connection for Oracle RAC database
Posted: Fri Oct 22, 2010 2:21 am
by rudolfo
Frankly, I had to look very long to figure out the difference between your connect URL from your initial post and the one in your last post about that you say that it is working. Finally I saw that the initial
jdbc: was not there. The jdbc: protocol prefix is automatically inserted by the wizard because you did select a JDBC connection to an existing database in the previous step.
I remember that in OOo version 2.x a splitted input method for the connection URL was used. Host (or ip) and port where to be given separately and validated and concatenated by the wizard. For other connection methods this might have been okay, but for JDBC I guess most users have pasted the jdbc connect string from the vendor's driver documentation. The separated input was rather confusing than helpful. Consequently version 3.x is using a single input field. But if you do a direct cut'n'paste of the full connection URL this will also include the jdbc prefix ending up with a duplicated "jdbc:jdbc:". With the first one being the template one with the grey background. Normally seeing such a duplicated part should ring all bells and whistles: "It's always the same with the online help, once you come to the tricky parts, you are left alone. Why can't they clearly say, if the grey "jdbc:" is only a label or it it will be used as part of the connection string!"
Okay, to be fair: It's a 50 to 50 chance! If your first assumption and attempt is wrong, you just try it the other way round.
For the sake of completeness: the connect URL is documented by
Oracle on RAC and JDBC driver.
And as you said that you have a working solution so please add [Solved] to the title of this thread. You will have to edit your first post to do this.