Fix connection URL example and link to Oracle docs#9044
Fix connection URL example and link to Oracle docs#9044hashhar merged 1 commit intotrinodb:masterfrom
Conversation
There was a problem hiding this comment.
Both are correct. Depends on how you want to connect to Oracle and what version of Oracle you are on.
Quoting the link you shared:
Starting Oracle Database 10g, Oracle Service IDs are not supported.
This is the one we use in our existing example.
Oracle also supports a lot of other ways (all mentioned in the linked document) but it's important to note:
Thin-style Service Name Syntax
jdbc:oracle:thin:scott/tiger@//myhost:1521/myservicename
This is the one you are adding now.
So IMO somehow we should make it more obvious that the example is just that - an example. People should consult the documentation to see whatever URL they should use.
There was a problem hiding this comment.
My understanding of documentation (https://docs.oracle.com/cd/B28359_01/java.111/b31224/urls.htm#BEIDHCBA) is that these are correct forms:
connection-url=jdbc:oracle:thin:@example.net:1521:ORCLCDBconnection-url=jdbc:oracle:thin:@//example.net:1521/ORCLCDB
connection-url=jdbc:oracle:thin:@example.net:1521/ORCLCDB is not correct
There was a problem hiding this comment.
But 12.x documentation here https://docs.oracle.com/en/database/oracle/oracle-database/21/tdpjd/getting-started.html#GUID-D1652CF5-5A80-40BF-BB96-016D1694BE5A gives example:
Connection connection =
DriverManager.getConnection("jdbc:oracle:thin:@localhost:1522/xepdb1", "hr", "hr");
So I guess all forms are correct...
There was a problem hiding this comment.
Given all that we should probably have multiple examples and links to the JDBC driver docs and explain that the URL just has to be valid for the driver use and the connected Oracle database from Trino..
There was a problem hiding this comment.
Followup question, the requirements section above says that you need Oracle 12 or higher, so should we even be documenting v11? I don't think we should provide example connection URLs for versions we say we don't support, a generic "refer to the Oracle docs for more information" should suffice.
There was a problem hiding this comment.
@mosabua The existing example is present in 12g documentation too - the last link that Pawel shared.
We can have multiple examples but it can't possibly be exhaustive. If left to me I'd just add a comment in the example config (before the connection-url line) that says to consult the Oracle documentation for the URL to use.
There was a problem hiding this comment.
Updated, please have a look to see if that's a good compromise.
There was a problem hiding this comment.
I remembered how to use git, apparently. 😅
Changes are there now.
e4c96f4 to
3d1573a
Compare
3d1573a to
e1a6a57
Compare
hashhar
left a comment
There was a problem hiding this comment.
Looks good to me now. Much better for people who are new to Oracle and liable to copy-pasting things.
Cherry-pick of trinodb/trino#9044 and Cherry-pick of trinodb/trino#11656 Co-authored-by: Joe Lodin <joe.lodin@starburstdata.com>
Cherry-pick of trinodb/trino#9044 and Cherry-pick of trinodb/trino#11656 Co-authored-by: Joe Lodin <joe.lodin@starburstdata.com>
Address an incorrect
connection-urlexample, and link to the corresponding Oracle doc for more info.