Results 1 to 6 of 6
  1. #1
    chyrl is offline Senior Member
    Join Date
    Mar 2010
    Location
    Manila, Philippines
    Posts
    257
    Rep Power
    5

    Exclamation Oracle Connect thru register driver

    I have been using the Oracle .jar files to connect the IDE (Netbeans and Eclipse). Using the jar files did help me through many personal projects I have accomplished. But I was wondering.

    1.) Is there an alternative way to connect the Oracle DB without the use of the .jar files. What I am to avoid is the lib folder created during building the project.

    2.) If there was a way, what could be the advantages and disadvantages between using the .jar files than the alternative way.

    3.) And in any way, which will you prefer most in particular, deployment, performance, and errorless issues.

    Thanks.
    Every project, package, class, method, variable, syntax, algorithm, etc.
    are registered in my memory bank. Thanks to this thread.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    Why avoid the lib directory?
    Almost every bit of Java worth anything is built on libraries of code, and consequently has dependencies...why try and avoid them?

    I've heard of people unzipping the jars and rebuilding them into a single app jar, but that strikes me as slightly absurd. And I wouldn't like to guarantee the licensing legalities of it with, say, Oracles driver.

    So, considering most software is packaged for deployment with a lib directory, especially web apps, then I would suggest not sticking with jars.

  3. #3
    chyrl is offline Senior Member
    Join Date
    Mar 2010
    Location
    Manila, Philippines
    Posts
    257
    Rep Power
    5

    Default

    I am avoiding the lib directory under the build directory for a single purpose.
    I wanted my build file to be the only file to be deployed without including anymore the lib folder (directory).

    If you may, Tolls, what are those dependecies you speak of.

    I understood your concern more clearly.
    Every project, package, class, method, variable, syntax, algorithm, etc.
    are registered in my memory bank. Thanks to this thread.

  4. #4
    chyrl is offline Senior Member
    Join Date
    Mar 2010
    Location
    Manila, Philippines
    Posts
    257
    Rep Power
    5

    Default

    In addition,

    I have researched about this code,
    Java Code:
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    What is the difference between using this code than adding the two .jar files for Oracle Thin Driver?
    Every project, package, class, method, variable, syntax, algorithm, etc.
    are registered in my memory bank. Thanks to this thread.

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    What are dependencies?
    Seriously?

    OK, you are dependent on the Java libraries supplied by Sun (or one of the other ones, say OpenJDK or IBM)...those do not need to be supplied by you. You are also dependent on any other code you use...stuff from Apache, Spring, Struts, or any number of other third party libraries. And, in your case, the Driver from Oracle.

    In Windows you have DLLs, in Linux you have link libraries...in Java you have jars.

    So, you supply the jars (libraries) you are dependent on when you hand over your app. Look at Eclipse, or Netbeans, or any number of other apps and see what they provide in order to run.

    As for registerDriver, that still requires you to have the jar file on the runtime classpath.

  6. #6
    chyrl is offline Senior Member
    Join Date
    Mar 2010
    Location
    Manila, Philippines
    Posts
    257
    Rep Power
    5

    Default

    Now I understood the importance of the .jar files and the lib directory.
    Then, it consider this thread solved.
    Every project, package, class, method, variable, syntax, algorithm, etc.
    are registered in my memory bank. Thanks to this thread.

Similar Threads

  1. Oracle Driver
    By Shadi-Palestine in forum JDBC
    Replies: 4
    Last Post: 06-23-2010, 01:51 AM
  2. Oracle connection and register
    By digioleg in forum New To Java
    Replies: 1
    Last Post: 08-19-2009, 08:43 PM
  3. can't register a MySQL driver
    By prfalco in forum New To Java
    Replies: 4
    Last Post: 02-04-2008, 12:13 AM
  4. Oracle Driver
    By softy in forum JDBC
    Replies: 1
    Last Post: 07-02-2007, 01:20 AM
  5. Oracle Driver
    By softy in forum Advanced Java
    Replies: 0
    Last Post: 06-28-2007, 03:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •