Oracle 10g JDBC question

Discussion in 'Java' started by waynes_zhong@yahoo.com, May 6, 2005.

  1. Guest

    Hi,

    I am currently using oracle/jdbc/lib/classes12.zip to connect to
    Oracle8i:

    String driver="oracle.jdbc.driver.OracleDriver";
    String url="jdbc:eek:racle:thin:mad:serverName:1521:dbName";
    String username="myOracleUsername";
    String password="myOraclePassword";

    (Setting: JDK1.4; Tomcat4)

    Now, if the db is upgraded to 10g, what do I expect in terms of jdbc
    driver settings?

    Thanks,

    Wayne
     
    , May 6, 2005
    #1
    1. Advertising

  2. No changes necessary. I think it would even work with the same driver
    but it is a wise thing to do to use new driver bundled with the 10g client.

    пишет:
    > Hi,
    >
    > I am currently using oracle/jdbc/lib/classes12.zip to connect to
    > Oracle8i:
    >
    > String driver="oracle.jdbc.driver.OracleDriver";
    > String url="jdbc:eek:racle:thin:mad:serverName:1521:dbName";
    > String username="myOracleUsername";
    > String password="myOraclePassword";
    >
    > (Setting: JDK1.4; Tomcat4)
    >
    > Now, if the db is upgraded to 10g, what do I expect in terms of jdbc
    > driver settings?
    >
    > Thanks,
    >
    > Wayne
    >
     
    Igor Kolomiyets, May 6, 2005
    #2
    1. Advertising

  3. Malte Guest

    wrote:
    > Hi,
    >
    > I am currently using oracle/jdbc/lib/classes12.zip to connect to
    > Oracle8i:
    >
    > String driver="oracle.jdbc.driver.OracleDriver";
    > String url="jdbc:eek:racle:thin:mad:serverName:1521:dbName";
    > String username="myOracleUsername";
    > String password="myOraclePassword";
    >
    > (Setting: JDK1.4; Tomcat4)
    >
    > Now, if the db is upgraded to 10g, what do I expect in terms of jdbc
    > driver settings?
    >
    > Thanks,
    >
    > Wayne
    >


    I use a connection String like yours for 9i and 10G without any changes
    necessary (for the thin driver).
     
    Malte, May 6, 2005
    #3
  4. sez:
    > Hi,
    >
    > I am currently using oracle/jdbc/lib/classes12.zip to connect to
    > Oracle8i:
    >
    > String driver="oracle.jdbc.driver.OracleDriver";
    > String url="jdbc:eek:racle:thin:mad:serverName:1521:dbName";
    > String username="myOracleUsername";
    > String password="myOraclePassword";
    >
    > (Setting: JDK1.4; Tomcat4)
    >
    > Now, if the db is upgraded to 10g, what do I expect in terms of jdbc
    > driver settings?


    Old driver may not work. I forget what the error message was,
    something to do with NLS charset. (Happens on some systems and
    update 3 of 10g.)

    New dirver is oracle.jdbc.OracleDriver. The one with .driver.
    is still supported for backwards compatibility but all new
    features go into the new one.

    Dima
    --
    One distinguishing characteristic of BOFHen is attention deficit disorder.
    Put me in front of something boring and I can find a near-infinite number
    of really creative ways to bugger off. -- ADB
     
    Dimitri Maziuk, May 7, 2005
    #4
  5. steve Guest

    On Fri, 6 May 2005 22:45:43 +0800, wrote
    (in article <>):

    > Hi,
    >
    > I am currently using oracle/jdbc/lib/classes12.zip to connect to
    > Oracle8i:
    >
    > String driver="oracle.jdbc.driver.OracleDriver";
    > String url="jdbc:eek:racle:thin:mad:serverName:1521:dbName";
    > String username="myOracleUsername";
    > String password="myOraclePassword";
    >
    > (Setting: JDK1.4; Tomcat4)
    >
    > Now, if the db is upgraded to 10g, what do I expect in terms of jdbc
    > driver settings?
    >
    > Thanks,
    >
    > Wayne
    >


    your drivers are out of date, you should be using atleast ocrs12.zip
    ,ojdbc14.jar.

    settings should be the same, I.E it works for me when i went from 8i to 9i
    to 10G
     
    steve, May 7, 2005
    #5
  6. . Guest

    On Fri, 6 May 2005 wrote:

    > Hi,
    >
    > I am currently using oracle/jdbc/lib/classes12.zip to connect to
    > Oracle8i:
    >
    > String driver="oracle.jdbc.driver.OracleDriver";
    > String url="jdbc:eek:racle:thin:mad:serverName:1521:dbName";
    > String username="myOracleUsername";
    > String password="myOraclePassword";
    >
    > (Setting: JDK1.4; Tomcat4)
    >
    > Now, if the db is upgraded to 10g, what do I expect in terms of jdbc
    > driver settings?


    If you switch to 10g you should switch to the drivers in ojdbc14.jar.
    There will be no changes to your code.

    NOTE: you can continue to use the classes12.zip but many things will not
    work. It is not JDBC 3.0 compliant. The driver in ojdbc14.jar is up to
    date and supports JDBC 3.0 APIs.

    --
    Send e-mail to: darrell dot grainger at utoronto dot ca
     
    ., May 9, 2005
    #6
  7. wrote:
    > Hi,
    >
    > I am currently using oracle/jdbc/lib/classes12.zip to connect to
    > Oracle8i:
    >
    > String driver="oracle.jdbc.driver.OracleDriver";
    > String url="jdbc:eek:racle:thin:mad:serverName:1521:dbName";
    > String username="myOracleUsername";
    > String password="myOraclePassword";
    >
    > (Setting: JDK1.4; Tomcat4)
    >
    > Now, if the db is upgraded to 10g, what do I expect in terms of jdbc
    > driver settings?


    You should also be careful if you intend on working with DATE columns...
    have a look at:

    http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm#08_01

    .... which explains the situation nicely!

    --
    Dave Ockwell-Jenner
    Solar Nexus Solutions
    http://www.solar-nexus.com/
     
    Dave Ockwell-Jenner, May 13, 2005
    #7
  8. Dave Ockwell-Jenner wrote:
    > wrote:
    >
    >> Hi,
    >>
    >> I am currently using oracle/jdbc/lib/classes12.zip to connect to
    >> Oracle8i:
    >>
    >> String driver="oracle.jdbc.driver.OracleDriver";
    >> String url="jdbc:eek:racle:thin:mad:serverName:1521:dbName";
    >> String username="myOracleUsername";
    >> String password="myOraclePassword";
    >>
    >> (Setting: JDK1.4; Tomcat4)
    >>
    >> Now, if the db is upgraded to 10g, what do I expect in terms of jdbc
    >> driver settings?

    >
    >
    > You should also be careful if you intend on working with DATE columns...
    > have a look at:
    >
    > http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm#08_01
    >
    >
    > ... which explains the situation nicely!


    Yep. I went around and round with them over this. Oracle misinterpreted
    the JDBC spec when they changed the mapping of their DATE column to a
    java Date object. Their enforcing correspondence of these column type
    *names* is petty and pointless. The names of columns bear no semantic
    relation or specified tie to Java or JDBC types. Oracle should clearly
    map both their DATE and TIMESTAMP columns to a java.sql.Timestamp because
    the semantics of both those columns have that meaning. What if Oracle
    invented a new decimal column that had higher precision than their current
    NUMBER column? Would they feel compelled to change their mapping of NUMBER
    to BIGINTEGER and lose all the sub-unit precision?
    Joe Weinstein at BEA
     
    Joe Weinstein, May 13, 2005
    #8
  9. Joe Weinstein sez:
    >

    .... What if Oracle
    > invented a new decimal column that had higher precision than their current
    > NUMBER column? Would they feel compelled to change their mapping of NUMBER
    > to BIGINTEGER and lose all the sub-unit precision?


    They map to BIGINTEGER now? Last time I tried

    switch( ResultSetMetaData.getColumnType( i ) ) {
    case java.sql.Types.INTEGER : ...
    case java.sql.Types.FLOAT : ...
    }

    I ended up with no numbers in the table -- they mapped everything
    to NUMERIC.

    Dima
    --
    Things seemed simpler before we kept computers. -- IX, Revelation
     
    Dimitri Maziuk, May 13, 2005
    #9
  10. Dimitri Maziuk wrote:

    > Joe Weinstein sez:
    >
    > ... What if Oracle
    >
    >>invented a new decimal column that had higher precision than their current
    >>NUMBER column? Would they feel compelled to change their mapping of NUMBER
    >>to BIGINTEGER and lose all the sub-unit precision?

    >
    >
    > They map to BIGINTEGER now? Last time I tried
    >
    > switch( ResultSetMetaData.getColumnType( i ) ) {
    > case java.sql.Types.INTEGER : ...
    > case java.sql.Types.FLOAT : ...
    > }
    >
    > I ended up with no numbers in the table -- they mapped everything
    > to NUMERIC.


    Right, no they don't. That's the point. No matter how many column types they
    have that semantically map to a given java.sql type, they should map them all
    to that type. Both their DATE and new TIMESTAMP columns store the date and time,
    so the driver should return a java.sql.Timestamp if I do a getObject() on either
    column, but by default (by fault imo) the 10g driver returns a java.sql.Date
    now for an oracle DATE column, so you lose the time component of your data!
    Joe

    >
    > Dima
     
    Joe Weinstein, May 14, 2005
    #10
  11. steve Guest

    On Sat, 14 May 2005 00:25:09 +0800, Joe Weinstein wrote
    (in article <>):

    >
    >
    > Dave Ockwell-Jenner wrote:
    >> wrote:
    >>
    >>> Hi,
    >>>
    >>> I am currently using oracle/jdbc/lib/classes12.zip to connect to
    >>> Oracle8i:
    >>>
    >>> String driver="oracle.jdbc.driver.OracleDriver";
    >>> String url="jdbc:eek:racle:thin:mad:serverName:1521:dbName";
    >>> String username="myOracleUsername";
    >>> String password="myOraclePassword";
    >>>
    >>> (Setting: JDK1.4; Tomcat4)
    >>>
    >>> Now, if the db is upgraded to 10g, what do I expect in terms of jdbc
    >>> driver settings?

    >>
    >>
    >> You should also be careful if you intend on working with DATE columns...
    >> have a look at:
    >>
    >> http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm#08_
    >> 01
    >>
    >>
    >> ... which explains the situation nicely!

    >
    > Yep. I went around and round with them over this. Oracle misinterpreted
    > the JDBC spec when they changed the mapping of their DATE column to a
    > java Date object. Their enforcing correspondence of these column type
    > *names* is petty and pointless. The names of columns bear no semantic
    > relation or specified tie to Java or JDBC types. Oracle should clearly
    > map both their DATE and TIMESTAMP columns to a java.sql.Timestamp because
    > the semantics of both those columns have that meaning. What if Oracle
    > invented a new decimal column that had higher precision than their current
    > NUMBER column? Would they feel compelled to change their mapping of NUMBER
    > to BIGINTEGER and lose all the sub-unit precision?
    > Joe Weinstein at BEA
    >



    yep the oracle advice if fucking shit.

    Alter you application to use getTimestamp rather than getObject. This is a
    good solution when possible, however many applications contain generic code
    that relies on getObject, so it isn't always possible.


    yep like when i loop round a resultset getting objects, now i have to stick
    in If statments to test if it is a "date" and branch to a "getTimestamp",
    not to mention all the extra code in a "custom table model" to display and
    the code needed to reformat dates to put them back into the database. ( no
    direct routines available to convert to and from the different formats!!)
     
    steve, May 15, 2005
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sloan

    Access Oracle 10g using ASP.NET

    sloan, Mar 10, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    2,293
  2. Betty
    Replies:
    1
    Views:
    9,937
    Juha Laiho
    May 21, 2005
  3. Replies:
    3
    Views:
    6,398
  4. Replies:
    0
    Views:
    769
  5. Replies:
    1
    Views:
    1,565
    RedGrittyBrick
    Sep 21, 2007
Loading...

Share This Page