Cannot get the correct data type in Oracle JDBC

Dear ALL:
I used JDBC ResultSetMetaData to get the column data type for Oracle Database. I created a table including 2 columns AAA, which is NUMBER type, BBB which is FLOAT type.
However, I found a problem that either NUMBER or FLOAT data types are reported as NUMBER type in JDBC.
IN SQL 2000, it is okay. SMALLINT, INT, TINYINT, etc..can be reported correctly.
Can anybody tell me that what's wrong here? I will be very appreciated.

hi,
i guess its a bug which is fixed with 10i.
Elango.

Similar Messages

  • Hi, can you help?  My emails that I have received show the date received as either today, yesterday or July 28.  How can I get the correct date received?

    Hi, The emails that I have received show the date received as either today, yesterday or July 28.  How can I get the correct date received?

    That's very scary. They might do it, but I personally have never had Apple contact me re id's except on their site when signing in. I suggest you DO NOT respond until you have a phone conversation with Apple security. They can verify if they sent you the e-mail and why.
    While it's very possible it's true,again, I suggest you not respond until you speak to someone at Apple. I've often read here that when people sign in they are not allowed to because "someone else has used the id" type of statement.
    Also, you should be able to go to the app store and see what apps you have downloaded.
    Though it could have been a free app, have you checked to see if any were bought with your id account?
    I've gotten these types of e-mails from places like USPS and FedEx which look amazingly authentic and were from their website. I also received an odd e-mail from my cousin in Ireland last year that clearly was not from him. It was also sent to others in his family in Ireland. I e-mailed him that I only opened it because it had a .ie, but suggested he change... Days later I received mail from 'him' - same name, but at yahoo.com. 
    Again, I would call Apple. You can also report it at [email protected], but I would not settle for that given your situation. If nothing else, call Apple sales (sales depts. anywhere answer fast) and ask them to transfer you to security. Apple will not want anybody accessing their name, and while it's unlikely, it's not impossible that it is someone phishing.
    Hope this helps and can you let the support community know your results by posting on this thread when you're done? Thank you.
    Hope this helps.

  • The dates my photos were taken are now incorrect.  Any suggestions on how to get the correct dates back?

    The dates my photos were taken are not incorrect.  Any suggestions on how to get the correct dates back?

    Thank you Winston.  This works and I can adjust several photos at the same time.

  • Is it possible to get the element data type of a Queue from itself?

    Hi everyone,
    i have a Q that has a cluster as element data type.
    now when i want to enqueue
    i'll use bundle-by-name
    and for that i'd have to have my data-type present
    (long cable from whereever (possibly from where i obtained the Q).
    my question is,
    whether there is a method/property-node/something that allows me to
    wire the Queue Refnum into it and receive the element-data-type,
    so i can then input into the top of bundle-by-name?
    (i really dont want to have that cable all over the place)
    the reason i ask here is that
    the help for the outgoing Queue Refnum from the Obtain Queue method,
    shows the element-data-type and so i hope there might be a solution.
    thx for your time
    and cheers
    j
    Solved!
    Go to Solution.

    If I understand your question correctly, the answer is "Yes, it's very easy ..."
    The answer is "Preview Queue".  Here I create a Queue of some mysterious type (it's a cluster having a Thing and a Center, but you don't know that yet).  I take the Queue reference from whereever I can find it and pass it into Preview Queue Element.  I take the output and use it to define my cluster in Bundle by Name.
    Two caveats.  This copies the first element of the Queue into the cluster, so you probably need to be sure to define all of the elements of your cluster.  But what if the Queue is empty (as mine is, above, as I just Obtained it) -- well, that's why 0 is wired into the TimeOut input, since I do not want to wait "forever" (-1) for the empty Queue to have an element!  Turns out that even in this case, you still get the correct Cluster elements!
    Neat, huh?
    Bob Schor

  • Ago function cannot show the correct data

    I created a logic columns to get the measure of last month. No error occurs but only get the unexpected data.
    Dont know why. Any advise?
    Logic column: Count of Last Month=ago("TEST"."Fact Transaction"."Count" , "TEST"."Time Hierarchy"."Month" ,1)
    Result:
    Month
    Count
    Count of Last Month
    4
    77
    0
    5
    130
    130
    6
    240
    240
    7
    180
    180
    8
    220
    220
    Time Hierarchy:
    Total->Year->Quarter->Month->Date->Hour->DateTime(key of the time dimension table)
    Ticked the 'Time Hierarchy' and set the 'Chronological Key' for each level.
    Have to mention that I created 2 Hierarchies for the time dimension table. The 2nd hierarchy is as below:
    Date Hierarchy:
    Total->Year->Quarter->Month->Date

    Seems it's caused by the 2 time-hierarchy. I built 2 time-hierarchy on one table, one has the week level the other doesn't. When I removed one, the result is correct.

  • Not getting the correct data at reciever side

    Hi
    I have done mail adapter... My senario is Mail --> XI --> File... In this mail adapter is sender. i have give the url as pop://<ip address> the xi server is picking up the file...
    Source File Is:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Mail_Message_Type xmlns:ns0="http://mailtofiledemo.com/ravi">
       <Order>
          <Header>
             <Name>Ravi</Name>
             <Address>Vsp</Address>
          </Header>
          <Item>
             <material>Computer</material>
             <units>3</units>
             <price>90000</price>
          </Item>
       </Order>
    </ns0:Mail_Message_Type>
    Target File is:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:File_Message_Type mlns:ns0="http://mailtofiledemo.com/ravi">
    <row>
       <name>Ravi</name>
       <address>Vsp</address>
       <material>Computer</material>
       <units>3</units>
       <price>90000</price>
    </row>
    I have  an unread mail in my Inbox and i have attached the source file to that mail... the server is picking up the file but in receiving side i am not getting the correct target file... i am getting the target file like:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:File_Message_Type xmlns:ns0="http://mailtofiledemo.com/ravi"></ns0:File_Message_Type>
    </ns0:File_Message_Type>
    eventhough if i dont have any unread mails in my inbox i am getting the same file at target side continuosly...so please give me the solution as early as possbile or else my folder will going to be overflow with that target file
    Thanks & Regards
    Ravi Shankar

    Ravi,
    Have to check the Transport Protocol used by internal Mail Server. The parametes you pass to the mail adapter should be same to the internal mail sever where you are trying to send and also check with XIPAYLOAD option.
    If this helps to u. Allot the points please.
    Thanks
    Gowri K

  • Failed to get Column's data type in Oracle 11g

    Hi,
    I made an ADO connection(Oracle provider) to Oracle 11g, and use ADO API: OpenSchema(adSchemaColumns) to fetch the columns' info. But I found I couldn't get the column's data type if it's type is timestamp or timestampwithtimezone in database. What I got is 'adIUnknown' whose number is 13.
    I test with another column whose data type is 'date', and everything is ok. I get the data type 'adDBTimeStamp'.
    This issue occurs on Oracle 10g, too.
    Can anyone offer some help? Thanks a lot!

    See
    http://www.oracle.com/technology/tech/windows/odpnet/index.html
    http://download.oracle.com/docs/cd/B28359_01/win.111/b28431/using.htm#CHDJJDAJ

  • How do I ensure a Map key maps to the correct data type?

    Hi,
    I have a simple event processing interface, where an Action class processes an event, and optionally generates a response event. I want to store a map of all registered actions, and then select the one matching an incoming event at run time:
    // the basic types
    public abstract class Event {
      protected String type;
      protected String data;
      public String getType()  { return type; }
      @Override
      public String toString() { return data; }
    // an action processes a request event and optionally returns a response event
    public interface Action<ReqE extends Event, ResE extends Event> {
      public ResE process(ReqE request);
    // two simple events
    public class Event1 extends Event {
      public Event1(String data) { this.type = "ev1"; this.data = data; }
    public class Event2 extends Event {
      public Event2(String data) { this.type = "ev2"; this.data = data; }
    // simple test class
    public class Test {
      Map<String, Action<? extends Event, ? extends Event>> actions
        = new HashMap<String, Action<? extends Event, ? extends Event>>();
      public void run() {
        // source event
        Event1 request = new Event1("hello");
        // register an action - takes an Event1 and returns an Event2
        actions.put(request.getType(), new Action<Event1, Event2>() {
          @Override
          public Event2 process(Event1 req) {
            return new Event2(req.data);
        // run it
        Action<Event, Event> action = getAction(request.getType());
        Event response = action == null ? null : action.process(request);
        System.out.println("Response=" + String.valueOf(response));
      public Action<Event, Event> getAction(String type) {
        return (Action<Event, Event>)actions.get(type);
      public static void main(String[] args) {
        new Test().run();
    }This all works, but the problem is obviously the cast in the getAction() method. I can see what the problem is: there is nothing to stop me registering a handler with the wrong event types:
      // register an action - this will fail at runtime as request is an Event1
      actions.put(request.getType(), new Action<Event3, Event4>() {
        @Override
        public Event4 process(Event3 req) {
          return new Event4(req.data);
      });So that leads to the map declaration. What I think I need to do is change the key of the map from String to... well, I'm not sure what! Some kind of parameterised EventType class that ties in to the event types of the parameterised Action class, so when I call:
      Map<????, Action<? extends Event, ? extends Event>> actions = ...
      actions.put(????, new Action<Event1, Event2>() {...});the key type ties in to Event1/Event2 so that it ensures the eventual call to "process" will receive the correct types. But this is really getting beyond my knowledge of generics!
    So if anybody has any useful pointers on where to go from here I'd be realy grateful.
    Cheers,
    Barney

    The obvious choice for the key would be the type of the request event instead of a plain String.
    Thus, declare the map like this:
    Map<Class<? extends Event>, Action<?,?>>Below, I've modified your code so that it is typesafe, provided you use the public methods "registerAction" and "getAction".
    import java.util.HashMap;
    import java.util.Map;
    abstract class Event {
           protected String type;
           protected String data;
           public String getType()  { return type; }
           @Override
           public String toString() { return data; }
         // an action processes a request event and optionally returns a response event
          interface Action<ReqE extends Event, ResE extends Event> {
           public ResE process(ReqE request);
         // two simple events
          class Event1 extends Event {
           public Event1(String data) { this.type = "ev1"; this.data = data; }
          class Event2 extends Event {
           public Event2(String data) { this.type = "ev2"; this.data = data; }
         // simple test class
         public class EventTest {
           Map<Class<? extends Event>, Action<?,?>> actions
             = new HashMap<Class<? extends Event>, Action<?,?>>();
           public void run() {
             // source event
             Event1 request = new Event1("hello");
             // register an action - takes an Event1 and returns an Event2
             registerAction(Event1.class, new Action<Event1, Event2>() {
               public Event2 process(Event1 req) {
                 return new Event2(req.data);
             // run it
             Action<? super Event1,?> action = getAction(Event1.class);
             Event response = action == null ? null : action.process(request);
             System.out.println("Response=" + String.valueOf(response));
           @SuppressWarnings("unchecked")
         public <E extends Event> Action<? super E,?> getAction(Class<E> type) {
             return (Action<? super E,?>)actions.get(type);
           public <E extends Event> void registerAction(Class<E> type, Action<? super E,?> action) {
                  actions.put(type, action);
           public static void main(String[] args) {
             new EventTest().run();
         }

  • URGENT! Getting the correct data from field BET01 in Infotype 0008

    Hello,
    I am trying to read the logs (Long-term PCL4) for the field BET01, BET02...in infotype 8. When I get the data from the logs, the value that appears in BET01 seems to be different from the value present in PA0008.
    Does this value depend on the wage types valuation? How is this value in the logs calculated? For the same amount present in pa0008-bet01 and for same wage type, i am seeing a different amount coming up from logs. Could anyone please help me with this to understand how the value in logs is being calculated?
    Thank you very much !

    If two users run the same select at the same time, they will ALWAYS come up with a duplicate doc code.
    The standard way to insure a unique code is to use an Oracle sequence.
    Otherwise, you could build your pl/sql into a stored procedure or package that inserts the new document code into the table before it passes it back to the user. This would prevent the second user from getting a duplicate, but would also stop user 2 from even getting a document code until user 1 did a commit.

  • [internalization] cannot get the correct local lang

    Hi there,
    I'm trying to develop an application based on the Internalization tutorial.
    I'm not getting any errors by the server, but the application doesn't change the local language.
    In the HTTP monitor I've got the following header parameter sent by the browser:
    accept-language it,it-it;q=0.8,en;q=0.5,en-us;q=0.3
    In the faces-config.xml
    <application>
        <locale-config>
          <default-locale>en</default-locale>
          <supported-locale>it</supported-locale>
        </locale-config>
      </application>In anycase I always get the en version.
    Is there anybody who can give some suggestion on how to find and correct the problem?
    Thanks in advance.
    Alessandro Ilardo

    ? question ?
    When the application is called for the first time by a browser, should it automatically detects the language? And consequently response with the correct language without displaying the default lang?

  • How get the correct generic type from Class.forName()?

    I have:
    public class Test2 {
        void foo() throws ClassNotFoundException {
            Class<Test2> c = Class.forName("Test2");
    }Of course, this doesn't compile:
    javac -Xlint Test2.java
    Test2.java:4: incompatible types
    found   : java.lang.Class<capture#965 of ?>
    required: java.lang.Class<Test2>
            Class<Test2> c = Class.forName("Test2");Other than casting to Class and suppressing the unchecked warning, how can I get the code to do what I think should be a common use case? I try
    public class Test2 {
        void foo() throws ClassNotFoundException {
            Class<Test2> c = Class.forName("Test2").asSubclass(Test2.class);
    }Which doesn't compile either:
    javac -Xlint Test2.java
    Test2.java:4: incompatible types
    found   : java.lang.Class<capture#400 of ? extends Test2>
    required: java.lang.Class<Test2>
            Class<Test2> c = Class.forName("Test2").asSubclass(Test2.class);Not sure I understand what the javac error is about.
    Help!

    kinmanc wrote:
    This is just a simplified version of what I had. The name of the class being loaded is unknown at compile time, though it is known to implement an interface. Isn't this a common use case?Yes, its' quite common.

  • I cannot get the cellular data account on my ipad.  I have gotten it in the past

    I Have an ipad . I'm trying to get my cellular data turned on and all I get is an error 500-- internal server error; the server encountered an unexpected condition which prevented it from fulfilling the request.  I have no internet service, but I do have wiFi. I have powered down.
    WHen I go to settings>cellular data> view my account I get the error code

    Hi,
    It might also help if you told us what you are doing to try and login which you think is right.
    One definition of crazy is repeating the same actions overs and over expecting different results.
    You could have an iPad that uses a SIM card as well as WiFi.
    You may not then get an alert about not being able to contact the servers.
    You may be doing all the right actions but have a poor and bad internet connection.
    Although it is unlikely the place you are at may be blocking the port Messages uses.
    More possible but also unlikely is that they (it is always "they") are blocking access to the servers by name. (Domain Blocking).
    9:37 pm      Saturday; January 11, 2014
      iMac 2.5Ghz 5i 2011 (Mavericks 10.9)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad

  • How to get the correct stored procedure in oracle

    Hi sir,
    i am having one stored procedure which i converted from sql it's compiled successfully.
    create or replace
    PROCEDURE Spvalidateholiday1
    v_pidate1 IN Date DEFAULT NULL ,
    v_piEmpid IN VARCHAR2 DEFAULT NULL ,
    v_pidate2 IN Date DEFAULT NULL ,
    v_poRetVal OUT Number
    --RETURN NUMBER
    AS
    v_date3 VARCHAR2(20);
    v_date4 VARCHAR2(20);
    v_date5 VARCHAR2(40);
    v_date6 VARCHAR2(40);
    v_scode VARCHAR2(10);
    v_dayoff1 VARCHAR2(20);
    v_dayoff2 VARCHAR2(20);
    BEGIN
    v_date5 := To_Char(To_Date(v_pidate1,'YYYY-MM-DD','D'));
    v_date6 := To_Char(To_Date(v_pidate2,'YYYY-MM-DD','D')) ;
    SELECT Shift_Code
    INTO v_scode
    FROM Employee
    WHERE Emp_ID = v_piEmpid;
    SELECT WeeklyOff1
    INTO v_dayoff1
    FROM Shift
    WHERE Shift_Code = v_scode;
    SELECT WeeklyOff2
    INTO v_dayoff2
    FROM Shift
    WHERE Shift_Code = v_scode;
    SELECT dayid
    INTO v_date3
    FROM Weekly
    WHERE dayss = v_dayoff1;
    SELECT dayid
    INTO v_date4
    FROM Weekly
    WHERE dayss = v_dayoff2;
    --select @date3=dayid from Weekly w join Site_Param s on w.dayss=s.WeeklyOff1
    --select @date4=dayid from Weekly w join Site_Param s on w.dayss=s.WeeklyOff2
    IF ( v_date5 = v_date3
    OR v_date6 = v_date4
    OR v_date4 = v_date5
    OR v_date3 = v_date6 ) THEN
    BEGIN
    v_poRetVal := 0 ;
    END;
    ELSE
    BEGIN
    v_poRetVal := 1 ;
    END;
    END IF;
    RETURN; --v_poRetVal;
    END;
    but getting error:
    ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'SPVALIDATEHOLIDAY1' ORA-06550: line 1, column 7: PL/SQL: Statement
    could u check the stored procedure?
    thanks

    Hi sir,
    i am calling it my application
    that is used like this
    Dim hshParam As New Hashtable
    hshParam.Add("Empid", '00000002')
    hshParam.Add("date1", '2012-10-25')
    hshParam.Add("date2", '2012-10-27')
    intRetProc = objDataTier.ExecuteStoredProcedureWithReturnT("Spvalidateholiday1", hshParam)
    and here is this method written:
    Public Function ExecuteStoredProcedureWithReturnT(ByVal sStroredProcedureName As String, ByVal phshTbl As Hashtable) As Integer
    Dim cmdCommand As OracleCommand
    Dim prmParmOutput As OracleParameter
    Dim pParam As IDictionaryEnumerator = phshTbl.GetEnumerator
    Dim sKey As String, sValue As String
    Try
    ExecuteStoredProcedureWithReturnT = True
    OpenDbConnection()
    cmdCommand = New OracleCommand(sStroredProcedureName, conConnection)
    cmdCommand.CommandType = CommandType.StoredProcedure
    cmdCommand.CommandTimeout = 0
    While pParam.MoveNext
    sKey = "v_pi" & pParam.Key
    sValue = pParam.Value
    cmdCommand.Parameters.Add(New OracleParameter(sKey, sValue))
    End While
    prmParmOutput = New OracleParameter
    cmdCommand.Parameters.Add(New OracleParameter("v_poRetVal", SqlDbType.Int)).Direction = ParameterDirection.Output
    ' If
    cmdCommand.ExecuteNonQuery()
    ExecuteStoredProcedureWithReturnT = CInt(cmdCommand.Parameters("v_poRetVal").Value)
    Catch ex As Exception
    ExecuteStoredProcedureWithReturnT = 2
    Throw ex
    End Try
    End Function
    now tell me is it correct?

  • How to get the correct sql command in oracle?

    Hi sir,
    i am using this query in sql that is :
    SELECT C.*,ISNULL(P.Comp_Name,'') + ' (' + ISNULL(P.Comp_ID,'') + ')' Parent FROM Comp_Master C LEFT JOIN Comp_Master P ON C.Parent_ID = P.Comp_ID Where C.Comp_ID='004'
    so i am getting in parent column value like this: "PARIS GROUP (001)"
    but the same command i converted in sql developer that is:
    SELECT C.* ,NVL(P.Comp_Name, ' ') || ' (' || NVL(P.Comp_ID, ' ') || ')' as Parent FROM Comp_Master C LEFT JOIN Comp_Master P ON C.Parent_ID = P.Comp_ID WHERE C.Comp_ID ='004'
    but not getting in parent column value its coming only ( )
    help me.
    thanks

    Welcome to Oracle.
    It has manuals.
    http://tahiti.oracle.com/
    Choose your version, which you continue to keep a mystery
    E.g.
    http://www.oracle.com/pls/db112/homepage
    Including Oracle SQL syntax
    http://docs.oracle.com/cd/E11882_01/server.112/e26088/toc.htm
    Which you will find useful since Oracle does not run Microsoft SQL as you continue to find over and over again.
    And there is a 2 day getting started as a developer guide, which you appear to desperately need,
    http://docs.oracle.com/cd/E11882_01/appdev.112/e10766/toc.htm
    If you have any specific questions about anything you read in there, come back in a couple of days after you have finished reading them.

  • Not getting the correct date..y?

    hi my pblm is that i am adding some date to a databse..the code like this
    <%@ page language="java" import="java.sql.*,java.text.SimpleDateFormat,java.util.*" %>
    <%
    SimpleDateFormat dateFormat = new SimpleDateFormat("dd-mm-yyyy");
    String d1=request.getParameter("dob");
    java.util.Date utilDob = dateFormat.parse(d1);
    out.println(utilDob);
    java.sql.Date sqlDob = new java.sql.Date(utilDob.getTime());
    out.println(sqlDob);
    st.setDate(12,sqlDob);
    My error is that whatever date i entered i am getting it as anyday/january/year
    the month is always january in the out.println() and in the database as well...y?
    help me plzzz...

    Your format string is incorect. Lowercase m stands for minute. You need an uppercase M for month.
    ie dd-MM-yyyy
    See the [SimpleDateFormat API|http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html] for details.
    Cheers,
    evnafets

Maybe you are looking for