What is JDBC driver anyway ?
When you want to make connections between any two machines where one is acting as a database and other may or may not be a database but just a simple computer, its done by specifying connection URLs. A Driver is just code that will enable connections with different databases.
The language in which application's code is written will decide which database connection driver you will be using. Read more on JDBC drivers here http://en.wikipedia.org/wiki/JDBC_driver
Now, coming to the JDBC drivers, look at the example of a driver below
com.microsoft.sqlserver.jdbc.SQLServerDriver
The orange part tells us which technology you will be using for the connectivity, here it is the Microsoft SQL server. It means there is some code at the db side which will help bridge the connection with application.
The yellow part tells us what coding language is used to establish the connection at the application side, jdbc here means java database connectivity. The next part SQLServerDriver tells us the database with the exact driver name.
Another example of SQL driver is
weblogic.jdbc.sqlserver.SQLServerDriver
Here it states that the connectivity to MS SQL with application (ODI which uses Java) will be established through Weblogic Application Server (Sometimes it is called the middle-layer)
[ It might sound geeky for beginners, so dont ponder much on this]
Since ODI is coded in Java, it will use JDBC to connect with other databases. These driver files (codes) are stored in a particular location where ODI will look up.
So tomorrow if you come up with your own database and want to connect it to ODI, where would you put the driver ?
The location is
C:\Users\username\AppData\Roaming\odi\oracledi\userlib
And one more thing, how does odi know that there are some additional drivers (code/jars) you need to refer to ?
In the same path above, there is a file named additional_path.txt, you specify the full path and the driver file name, see the contents I put after adding a sqljdbc4.jar driver file in that folder above.
Though sometimes ODI is clever enough to get the drivers without updating the above file.
; Additional paths file
; You can add here paths to additional libraries
; Examples:
; C:\ java\libs\myjar.jar
; C:\ java\libs\myzip.zip
; C:\java\libs\*.jar will add all jars contained in the C:\java\libs\ directory
; C:\java\libs\**\*.jar will add all jars contained in the C:\java\libs\ directory and subdirectories
C:\Users\username\AppData\Roaming\odi\oracledi\userlib\*.jar
And dont forget to restart ODI (Close ODI studio and open again) if you add your driver.
Note : For Experts
The location just doesnt specify putting Driver files, you can also put some of your own java classes if you want at this location. You can put your groovy scripts and external jars that might be used if you are going to customize anything in ODI.
When you want to make connections between any two machines where one is acting as a database and other may or may not be a database but just a simple computer, its done by specifying connection URLs. A Driver is just code that will enable connections with different databases.
The language in which application's code is written will decide which database connection driver you will be using. Read more on JDBC drivers here http://en.wikipedia.org/wiki/JDBC_driver
Now, coming to the JDBC drivers, look at the example of a driver below
com.microsoft.sqlserver.jdbc.SQLServerDriver
The orange part tells us which technology you will be using for the connectivity, here it is the Microsoft SQL server. It means there is some code at the db side which will help bridge the connection with application.
The yellow part tells us what coding language is used to establish the connection at the application side, jdbc here means java database connectivity. The next part SQLServerDriver tells us the database with the exact driver name.
Another example of SQL driver is
weblogic.jdbc.sqlserver.SQLServerDriver
Here it states that the connectivity to MS SQL with application (ODI which uses Java) will be established through Weblogic Application Server (Sometimes it is called the middle-layer)
[ It might sound geeky for beginners, so dont ponder much on this]
Since ODI is coded in Java, it will use JDBC to connect with other databases. These driver files (codes) are stored in a particular location where ODI will look up.
So tomorrow if you come up with your own database and want to connect it to ODI, where would you put the driver ?
The location is
C:\Users\username\AppData\Roaming\odi\oracledi\userlib
And one more thing, how does odi know that there are some additional drivers (code/jars) you need to refer to ?
In the same path above, there is a file named additional_path.txt, you specify the full path and the driver file name, see the contents I put after adding a sqljdbc4.jar driver file in that folder above.
Though sometimes ODI is clever enough to get the drivers without updating the above file.
; Additional paths file
; You can add here paths to additional libraries
; Examples:
; C:\ java\libs\myjar.jar
; C:\ java\libs\myzip.zip
; C:\java\libs\*.jar will add all jars contained in the C:\java\libs\ directory
; C:\java\libs\**\*.jar will add all jars contained in the C:\java\libs\ directory and subdirectories
C:\Users\username\AppData\Roaming\odi\oracledi\userlib\*.jar
And dont forget to restart ODI (Close ODI studio and open again) if you add your driver.
Note : For Experts
The location just doesnt specify putting Driver files, you can also put some of your own java classes if you want at this location. You can put your groovy scripts and external jars that might be used if you are going to customize anything in ODI.
2 comments:
Hi !
Thanx a lot for this explanation. Reading and testing it, I have a question : I saw that these directories don't exist in my AppData folder, but I also saw in the ODI installation folder a directory named "drivers", would these operations work there to ?
Hi again,
The answer is yes, it works.
Post a Comment