A silly question about oracle.sql.timestamp and java.sql.timestamp

Hi,
I'm looking at a method that takes objects of type Object and does stuff if the object is really a java.sql.timestamp. If it is not then an error is flagged. In my case it flags an error when an object of type oracle.sql.timestamp is passed to it. Not really entirely comfortable with java (i'm still learning it), here's my stupid question :- why isn't oracle.sql.timestamp a subclass of java.sql.timestamp? Also in various books it indicates that java.sql.timestamp maps to oracle.sql.timestamp. Does that mean you have to physically do the mapping:
i.e.
java.sql.Timestamp t = new Timestamp( new oracle.sql.Timestamp( CURRENTTIMESTAMP ).timestampValue() );
or is there something else to it.
Thanks.
Harold.

The best forum for this is probably Forum Home » Java » SQLJ/JDBC
Presumably you are refering to oracle.sql.TIMESTAMP. While this is intended to (and does) correspond to java.sql.Timestamp it can't be a subclass because it needs to be a subclass of oracle.sql.Datum.

Similar Messages

  • Conversions between java.util.Date, java.util.Timestamp and java.sql dates

    I am coding a hoilday booking system using JSP to interact with a SQL Server database. On my JSP form which retrieves the information I have a little javascript pop-up date selector which appears to be returning a Timestamp value although the string value is visable in the entry field. Can I pass this to a javabean as a Timestamp, so far I have only passed strings? Also I then have to enter it in the database and so will need to convert it to an sql date type but I dont know which one is best. Previous to using the Timestamp returning calendar I was just entering text and parsing it to a util.Date in the bean and then converting that to an sql.Date for entry in the database. That worked fine but I want to use the pop-up any ideas? Also my bean won't compile if I declare java.util.Timestamp t;(cannot resolve symbol Timestamp !) even though I have imported util.

    First of all, java.util.Timestamp does not exist. You probably need java.sql.Timestamp.
    java.sql.Date and java.sql.Timestamp inherit from java.util.Date. So converting from java.sql.Date or java.sql.Timestamp to java.util.Date is easy, you don't have to do anything.
    To convert a java.util.Date to a java.sql.Timestamp, do something like this:
    import java.sql.Timestamp;
    import java.util.Date;
    Date date = new Date();
    Timestamp ts = new Timestamp(date.getTime());Jesper

  • Oracle 9.x and java.sql.Timestamp

    Are there any documents or examples illustrating the interaction of the Oracle 9.x [SQL92] TIMESTAMP and the timezone varient of TIMESTAMP?

    Erm,
    One way to find out, I reckon.
    Good Luck,
    Avi.

  • Newbie question about Oracle Parallel Server and Real Application Cluster

    I am trying to find out what kind of storage system is supported by the 9i Real Applicaton cluster. I have looked at the 8i Oracle Parallel Server which requires raw partitions and therefore NAS (network attached storage) that provides an interface at the file level will not work. Does anyone know if the 9i Real Application cluster has a similar requirement for raw partitions? any suggestions of whether SAN or other technology will be suitable? pointers to more information is appreciated.
    Robert

    Hi Derik,
    I know this is a really broad question. No, it happens all the time! Here is a similar issue:
    http://blog.tuningknife.com/2008/09/26/oracle-11g-performance-issue/
    +"In the end, nothing I tried could dissuade 11g from emitting the “PARSING IN CURSOR #d+” message for each insert statement. I filed a service request with Oracle Support on this issue and they ultimately referred the issue to development as a bug. Note that Support couldn’t reproduce the slowness I was seeing, but their trace files did reflect the parsing messages I observed."+
    I would:
    1 - Start by examining historical SQL execution plans (stats$sql_plan or dba_hist_sql_plan). Try to isolate the exact nature of the decreased performance.
    Are different indexes being used? Are you geting more full-table scans?
    2 - Migrate-in your old 10g CBO statistics
    3 - Confirm that all init.ora parms are identical
    4 - Drill into each SQL with a different execution plan . . .
    Raid 5 Don't believe that crap that all RAID-5 is evil. . . .
    http://www.dba-oracle.com/t_raid5_acceptable_oracle.htm
    But at the same time, consider using the Oracle standard, RAID-10 . . .
    Hope this helps . . .
    Donald K. Burleson
    Oracle Press author
    Author of "Oracle Tuning: The Definitive Reference"
    http://www.rampant-books.com/t_oracle_tuning_book.htm
    "Time flies like an arrow; Fruit flies like a banana".

  • A question about Oracle 1g R2 Enterprise Edition license

    Dear all,
    I have a question about Oracle license and I would appreciate if you could kindly help me.
    I have installed an Oracle server (11g R2 Enterprise edition) on a linux virtual machine. The pc used for this purpose
    is my enterprise laptop (therefore a professional and not a personal Computer). However, I use the this Oracle Server
    only for learning purpose, that is, only for running the examples in my Oracle Press books (SQL, PL/SQL and some
    administration tasks) just for learning the stuff.
    There is absolutely no data related to my enterprise, stored or used on this server. Whenever I want to work with my
    enterprise data, I use the Oracle server of the enterprise which has of course the appropriate license. So as I said, I
    use this Enterprise server on the virtual machine only for running queries/programs in my Oracle Press books just for
    learning and I'm the sole person who uses this server (no remote connection for other users).
    The reason for which I needed to install this server on my PC was that our DBA couldn't provide a training environment
    for me with all required privileges and functionalities.
    Am I supposed to buy a license for this installed Enterprise server on my virtual machine?
    Thanks in advance,
    Dariyoosh

    drop.any wrote:
    From OTN license agreement:
    >
    LICENSE RIGHTS
    We grant you a nonexclusive, nontransferable limited license to use the programs only for the purpose of developing, testing, prototyping and demonstrating your application, and not for any other purpose. If you use the application you develop under this license for any internal data processing or for any commercial or production purposes, or you want to use the programs for any purpose other than as permitted under this agreement, you must obtain a production release version of the program by contacting us or an Oracle reseller to obtain the appropriate license. You acknowledge that we may not produce a production release version of the program and any development efforts undertaken by you are at your own risk. We may audit your use of the programs. Program documentation, if available, may accessed online at http://otn.oracle.com/docs.
    Ownership and Restrictions We retain all ownership and intellectual property rights in the programs. The programs may be installed on one computer only, and used by one person in the operating environment identified by us. You may make one copy of the programs for backup purposes.
    You may not:
    - use the programs for your own internal data processing or for any commercial or production purposes, or use the programs for any purpose except the development of your application;
    - use the application you develop with the programs for any internal data processing or commercial or production purposes without securing an appropriate license from us;
    - continue to develop your application after you have used it for any internal data processing, commercial or production purpose without securing an appropriate license from us, or an Oracle reseller;
    - remove or modify any program markings or any notice of our proprietary rights;
    - make the programs available in any manner to any third party;
    - use the programs to provide third party training;
    - assign this agreement or give or transfer the programs or an interest in them to another individual or entity; - cause or permit reverse engineering (unless required by law for interoperability), disassembly or decompilation of the programs;
    - disclose results of any program benchmark tests without our prior consent.
    >Hello again,
    Thank you both of you for your help. As it seems to me
    >
    We grant you a nonexclusive, nontransferable limited license to use the programs only for the purpose of developing, testing, prototyping and demonstrating your application, and not for any other purpose.
    >
    I think self training can be considered in this category, therefore I think there is no need to buy a license for that.
    Kind regards,
    Dariyoosh

  • Several questions about oracle ASM in 11gR2.

    Hi, all.
    The db is 11.2.0.3 on a linux machine.
    I have several questions about oracle ASM functionality.
    1. V$ASM_DISKGROUP.ALLOCATION_UNIT_SIZE is the stripe size in bytes??
    2. V$ASM_DISK.DISK_NUMBER is unique to a physical disk??
    3. if the second question is the case,
    disk_number=0 (a physical disk) has 14 partition on it.
    And each partition belongs to several diskgroups.
    Is ths right??
    with q1 as (
         select /*+ use_hash(b,a) */
              disk_number,b.group_number,b.name,a.path,sum(os_mb) tot_size ,count(*) cnt
         from v$asm_disk a, v$asm_diskgroup b
         where a.group_number=b.group_number
         group by disk_number,b.group_number,b.name,a.path
         order by disk_number,b.group_number,b.name
    select disk_number,group_number,name,path,tot_size,
           sum(tot_size) over (partition by disk_number) disk_size,
           sum(cnt) over (partition by disk_number) parition_cnt_per_disk
      from q1
      order by q1.disk_number,group_number
    DISK_NUMBER     GROUP_NUMBER     NAME     PATH     TOT_SIZE     DISK_SIZE     PARITION_CNT_PER_DISK
    0     1     ARCH     /dev/raw/raw100     53256     454460     14
    0     2     AAAREDO1     /dev/raw/raw111     10240     454460     14
    0     3     AAAREDO2     /dev/raw/raw113     10240     454460     14
    0     4     CRS     /dev/raw/raw83     3000     454460     14
    0     5     BBBDATA1     /dev/raw/raw10     50232     454460     14
    0     6     BBBDATA2     /dev/raw/raw41     50232     454460     14
    0     7     BBBREDO1     /dev/raw/raw1     10240     454460     14
    0     8     BBBREDO2     /dev/raw/raw3     10240     454460     14
    0     9     CCCDATA1     /dev/raw/raw75     76400     454460     14
    0     10     CCCDATA2     /dev/raw/raw165     51300     454460     14
    0     11     CCCREDO1     /dev/raw/raw118     10240     454460     14
    0     12     CCCREDO2     /dev/raw/raw120     10240     454460     14
    0     13     CCCDATA1     /dev/raw/raw125     51300     454460     14
    0     14     BBBDDATA     /dev/raw/raw71     57300     454460     14
    .Thanks in advance..
    Best Regards.
    Edited by: 869578 on 2012. 12. 23 오후 10:05

    1. No. The stripe size always equals 128 KB in any configuration.
    (http://docs.oracle.com/cd/E11882_01/server.112/e18951/asmcon.htm#BABCGDBF)That is not a true statement. Please read the document, the stripe size depends upon what method of striping we using (fine-grained or coarse-grained)
    --from the same oracle document:
    To stripe data, Oracle ASM separates files into stripes and spreads data evenly across all of the disks in a disk group. The fine-grained stripe size always equals 128 KB in any configuration; this provides lower I/O latency for small I/O operations. The coarse-grained stripe size is always equal to the AU size (not the data extent size).
    --are we using fine grained or coarse-grained ? and how to change the striping method (using TEMPLATES)
    http://docs.oracle.com/cd/E11882_01/server.112/e16102/asmfiles.htm#g2223792
    also see following:
    http://oracletechlovers.blogspot.com/2012/06/asm-differences-between-corse-and-fine.html

  • Mapping between oracle data types and ms sql server data types

    hello
    i need mapping between oracle data types and ms sql server data types
    where can i find them ?

    read this
    http://download.oracle.com/docs/cd/E10405_01/doc/appdev.120/e10379/ss_oracle_compared.htm

  • Few questions about Oracle Times ten

    Moved to Few questions about Oracle Timesten
    Edited by: ankurk on Nov 4, 2010 6:50 PM
    Moved to right place... timesten

    Hi,
    it is better to ask in the [url http://forums.oracle.com/forums/forum.jspa?forumID=244] Times Ten Forum.
    Herald ten Dam
    http://htendam.wordpress.com

  • HT201263 What will i do?screenshot There is a problem with your iPhone. Please visit the Service Answer Center to find answers to all your questions about service options, warranty and other processes in your country. To find your nearest Apple Store, cli

    What will i do? ITune screenshot is as follows >
    There is a problem with your iPhone. Please visit the Service Answer Center to find answers to all your questions about service options, warranty and other processes in your country. To find your nearest Apple Store, click here.

    Do what it said to do.
    "Please visit the Service Answer Center to find answers to all your questions about service options, warranty and other processes in your country. "

  • TS1814 There is a problem with your iPhone. Please visit the Service Answer Center to find answers to all your questions about service options, warranty and other processes in your country. To find your nearest Apple Store, click here.

    There is a problem with your iPhone.
    Please visit the Service Answer Center to find answers to all your questions about service options, warranty and other processes in your country.
    To find your nearest Apple Store, click here.
    Please help me i can aktivate my phone imei 012423006333181.

    There is a problem with your iPhone.
    Please visit the Service Answer Center to find answers to all your questions about service options, warranty and other processes in your country.
    To find your nearest Apple Store
    no imei also

  • Import and process larger data with SQL*Loader and Java resource

    Hello,
    I have a project to import data from a text file in a schedule. A lager data, with nearly 20,000 record/1 hours.
    After that, we have to analysis the data, and export the results into a another database.
    I research about SQL*Loader and Java resource to do these task. But I have no experiment about that.
    I'm afraid of the huge data, Oracle could be slowdown or the session in Java Resource application could be timeout.
    Please tell me some advice about the solution.
    Thank you very much.

    With '?' mark i mean " How i can link this COL1 with column in csv file ? "
    Attilio

  • I need some working examples with pl/sql records and pl/sql tables.

    i am new to pl/sql tables and pl/sql records. i need some working examples on pl/sql records and pl/sql tables from basics to hoghlevel.how to use then procedures and functions and packages.

    i am new to pl/sql tables and pl/sql records. i need some working examples on pl/sql records and pl/sql tables from basics to hoghlevelThere is no such thing as PL/SQL "+tables+". This is a misnomer and creates the perception that a PL/SQL "table" is somewhat like a SQL table. Nothing can be further from the truth. The correct term is "+collection+" or "+associative array+". Compared to SQL tables, these are very primitive structures, very rigid structures, cannot scale, and can be quite expensive memory wise.
    That is not to say do not use an associative array or collection. These are very useful tools.. but only when applied correctly. Like using a collection for a bulk fetch to transfer more rows between the PL and SQL engines and thus decrease context switching.
    Unfortunately, quite often we see the row-by-row and slow-by-slow approach - where the developer uses SQL as an I/O only layer, pulls rows into expensive PL engine memory into record structures and arrays, and then process the rows there.
    So before looking at working example (even the wrong approach's code will compile and run and work in practice), make sure that you know the fundamentals of correctly using the PL engine and correctly using the SQL engine. And these fundamentals can be summed up into a very basic rule:
    Maximize SQL. Minimize PL/SQL+
    Get this rule right, and you will have a sound foundation for writing performant and scalable Oracle applications.

  • What is the diffrence between package javax.sql and java.sql

    Is javax designed for J2EE?
    And when to use package javax?

    Hi,
    What is the diffrence between package javax.sql and java.sql?The JDBC 2.0 & above API is comprised of two packages:
    1.The java.sql package and
    2.The javax.sql package.
    java.sql provides features mostly related to client
    side database functionalities where as the javax.sql
    package, which adds server-side capabilities.
    You automatically get both packages when you download the JavaTM 2 Platform, Standard Edition, Version 1.4 (J2SETM) or the JavaTM 2, Platform Enterprise Edition, Version 1.3 (J2EETM).
    For further information on this please visit our website at http://java.sun.com/j2se/1.3/docs/guide/jdbc/index.html
    Hope this helps.
    Good Luck.
    Gayam.Srinivasa Reddy
    Developer Technical Support
    Sun Micro Systems
    http://www.sun.com/developers/support/

  • Datasource, POJO and java.sql.Blob

    Hello,
    is "java.sql.Blob" a valid type for a POJO datasource ?
    I declared one but I just dit not succeed in rendering its jpg picture.
    My java code is quite simple :
    ReportClientDocument reportClientDocument = new ReportClientDocument ();
    reportClientDocument.setReportAppServer(ReportClientDocument.inprocConnectionString);
    reportClientDocument.open (REPORT_NAME, OpenReportOptions._openAsReadOnly);
    // lBlob is a class which implements java.sql.Blob interface
    LPOJOData [] dataP = {new LPOJOData(new lBlob("Picture.jpg"))};
    POJOResultSetFactory factory = new POJOResultSetFactory(LPOJOData.class);
    POJOResultSet resultSet = factory.createResultSet(dataP);
    reportClientDocument.getDatabaseController().setDataSource(resultSet, "", "");
    and my POJO class :
    public class LPOJOData {          
              private java.sql.Blob zimage;
              public LPOJOData(java.sql.Blob zp){
                   this.zimage = zp;
              public java.sql.Blob getzimage(){
                   return zimage;
    The field "zimage" on the report is designed through a "field definition only" database, zimage is defined as a Blob field.
    Any clues ?
    Regards,
    Serge

    I have just found a list of the data types supported by a POJO Class :
    # boolean
    # byte
    # char
    # double
    # float
    # int
    # short
    # java.lang.Boolean
    # java.lang.Byte
    # java.lang.Double
    # java.lang.Float
    # java.lang.Integer
    # java.lang.Short
    # java.lang.String
    # java.SQL.Date
    # java.SQL.Time
    Well, java.SQL.Blob is not one of them.
    Is java.SQL_Blob will be a valid POJO type in the future ?
    Is there another way than POJO to feed a report from an in-memory datasource ?

  • Java.sql.Date and java.util.Date - class loaded first in the classpath

    I had two jar files which has java.util.Date and java.sql.Date class file. i want to know whether which class is loaded first in the classpath...
    I like to change the order of loading the class at runtime...
    Is there is any way to change the order of loading of class...
    I may have different version of jar files for example xerces,xercesImpl. some of the code uses xerces ,some of the code uses xercesImpl..i had common classes.
    I like to load the class with the same name according to the order i need..
    Can we do all these in Run time ?????

    I had two jar files which has java.util.Date and
    java.sql.Date class file. i want to know whether
    which class is loaded first in the classpath...
    I like to change the order of loading the class at
    runtime...
    Is there is any way to change the order of loading of
    class...
    I may have different version of jar files for example
    xerces,xercesImpl. some of the code uses xerces ,some
    of the code uses xercesImpl..i had common classes.
    I like to load the class with the same name according
    to the order i need..
    Can we do all these in Run time ?????That is meaningless.
    The classes you are referring to are part of the Java API. Third party jars have no impact on that. And you can't change to the order because java.sql.Data is derived from java.util.Date. So the second must load before the first.
    And if you have two jar files with those classes in them (and not classes that use them) then you either should already know how to use them or you should stop trying to do whatever you are doing because it isn't going to work.

Maybe you are looking for