HELP Conversion of string into SOAPMessage/SOAPPart

I'm trying to convert a soap message that is stored in a String into a SOAPPart object, but I have some troubles.
I thought this (code below) should work, but it gives a java.lang.ClassCastException at org.apache.axis.utils.XMLUtils.sourceToInputSource(XMLUtils.java:651)
Can anyone help me, please??? Isn't there an easier way to convert a String into a SOAPPart?
SOAPConnectionFactory scFactory = SOAPConnectionFactory.newInstance();
MessageFactory factory = MessageFactory.newInstance();
SOAPMessage message = factory.createMessage();
SOAPPart soapPart = message.getSOAPPart();
String input = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"......... etc
DOMParser domParser = new DOMParser();
Reader read = new StringReader(input);
InputSource in = new InputSource();
in.setCharacterStream(read);
domParser.parse(in);
Document doc = domParser.getDocument();
DOMSource domSource = new DOMSource(doc);
soapPart.setContent(domSource);                

Why would you want to convert a String into a SOAPPart ?

Similar Messages

  • Conversion of string into XML object

    Hi
    I am having some problems with conversion of string (containing XML data) into Flex XML object and binding it later to UI elements to output/maintain this data.
    Binding of XML structure to UI elements works perfectly fine if I will do following:
    1)      Hardcode XML object within Flex file
    2)      Read xml file from repository (xml file inside the Flex project)
    3)      Use HTTP request to retrieve XML data
    Unfortunately none of the above scenarios suits my solution.
    I am developing a prototype application for processing Flex forms inside SAP system. I have decided to make data bindings using XML structure stored in Data Base. When rendering form inside web browser based application I am retrieving corresponding XML schema (empty for new forms and populated for saved forms) and pass it to Flex form as a string type import parameter. Data is being passed correctly (I can display it on TextArea control for instance) but after conversion to XML and binding to DataGrid I am not getting any results.
    I am converting string (containing XML) to XML object in following way:
    Private var xml_obj:XML = new XML(string_xml );
    I am catching any potential errors but conversion is going well. After conversion I am not getting any results after binding it to DataGrid control and I am not able to access any of the nodes using AS code either. At the same time variable xml_obj is not empty (not null).
    Any help would be much appreciated.
    Regards
    Michael

    David
    First of all sorry for not stating it clearly but I am using Flex 3 for this development (at the moment it is the only choice when embedding Flex objects inside SAP applications).
    You must have missed the bit where I am describing how this XML data finds its way inside Flex. I am passing it to Flex as String type parameter during rendering (directly from DB where it is stored).
    Now, following code works perfect (XML is embedded inside Flex project):
                    <mx:XML id="form_data" source="../assets/example_xml_data.xml"/>
                    <mx:Script>
                                    <![CDATA[
                                                    import mx.collections.XMLListCollection;
                                                    import mx.controls.Alert;
                                                    [Bindable]
                                                    public var XML_list:XMLListCollection;
                                                    private function setParameters():void
                                                                   XML_list = new XMLListCollection(form_data.*);             
                                    ]]>
                    </mx:Script>
                    <mx:DataGrid id="myDataGrid" dataProvider="{XML_list}">
                                    <mx:columns>
                                                    <mx:DataGridColumn dataField="COMMON" headerText="Popular name"/>
                                                    <mx:DataGridColumn dataField="BOTANICAL" headerText="Botanical name"/>
                                                    <mx:DataGridColumn dataField="ZONE" headerText="Zone"/>
                                                    <mx:DataGridColumn dataField="LIGHT" headerText="Light"/>                                                                                                                                               
                                                    <mx:DataGridColumn dataField="PRICE" headerText="Price"/>                                               
                                                    <mx:DataGridColumn dataField="AVAILABILITY" headerText="Availability"/>                                    
                                    </mx:columns>               
                    </mx:DataGrid>
    But following code does not work (XML passed to Flex form as String input parameter):
    import sap.FlashIsland;
    import mx.controls.Alert;
    import mx.collections.XMLListCollection;
    [Bindable]
    public var xml_data:String;
    private var form_data:XML;
    [Bindable]
    private var XML_list:XMLListCollection;
    private function initApp():void
                    FlashIsland.register(this);
    private function setParameters():void
                    try
                                    form_data=new XML(xml_data);
                    catch (error:Error)
                                    Alert.show(error.toString());
                      XML_list = new XMLListCollection(form_data.*);           
    XML string does find its way inside Flex form. I can display content of variable xml_data in TextArea and all looks fine. Conversion to XML (variable form_data) goes well (no error)
    Please helpJ
    Regards
    Michael

  • Conversion of string into date????????????

    Can anyone tell how to convert a String into date??
    if the string is in the format "Thu Mar 25 17:11:34 GMT+05:30 2004"
    i have converted it. code is
    SimpleDateFormat dateFormat = new SimpleDateFormat("EEE MMM d yyyy HH:mm:ss");
         dateFormat.setTimeZone(TimeZone.getTimeZone("GMT+00:00"));
    Date date = null;
    try
              //date = dateFormat.parse(new Date().toString());
              date = dateFormat.parse(dateLine);
         catch(ParseException ex)
    but i am not able to specify the year.
    so when i getYear on the new Date it return 1970.

    @duffymo, I'm pretty sure "d" is good for a two digit date, "dd" gives you zero-padding.
    The problem, presumably, is that the format string "EEE MMM d yyyy HH:mm:ss" does not match the actual format "Thu Mar 25 17:11:34 GMT+05:30 2004".
    The correct format string would be "EEE MMM d HH:mm:ss z yyyy"

  • Req help in conversion of string to array of args

    Hi,
    i need help in converting a string into array of args just like command line args
    i have a string s1 = 12 13 56 etc
    now i want to copy that into an array a[]
    a[0] = 12
    a[1] = 13 etc
    Thanks for help

    U can use String tokenizer.Why prefer that over split?Yah Bobby u can use split too..
    J2SE 1.4 added the split() method to simplify the task of breaking a string into substrings, or tokens.
    Thanks BigDaddy.. I realized after you told.
    try this too..
    String str = "Your string";
    String[] arr = str.split (" ");
    for (int i=0; i < arr.length; i++)
    System.out.println (arr);

  • Conversion of binary string into headecimal

    Ho will i convert binary string into hexadecimal fromat

    HI,
    Thanks but the above module is not present my system.
    I have number which needs to be converted into binary first and then into Hex.
    I have written it code for conversion of decimal number into Binary.But i am not able to convert it into Hex.
    My rough code is ....
    types : begin of t_temp,
            r1 type i,
            end of t_temp.
    data : ty_temp type standard table of t_temp ,
           wa_temp type t_temp.
    DATA : num TYPE i,
           temp1 TYPE string,
           temp2 TYPE string,
           temp3 TYPE string,
           temp4 TYPE x.
    temp1 = 0.
    temp2 = ''.
    num = 64.
    while num ne 1.
      temp1 = num MOD 2.
      num = num / 2.
      If temp1 = 1.
        num = num - 1.
      endif.
      concatenate temp1 temp2 into temp2 .
    endwhile.
      temp1 = 1.
      concatenate temp1 temp2 into temp2 .
      condense temp2 no-gaps .
      WRITE : temp2 .

  • Please help me with my code (has conversion from string to int)

    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    public class Test3 extends MIDlet implements CommandListener
    {   Form mForm;
        Command mCommandQuit;
        Command mCommandItem;
        TextField input,prime1,prime2,prime3,output;
        Display mDisplay;
        int i,j=0,k1,k2,p,q,b;
        //int [] current=new int [1000];
        String mstring,a="";
        String [] temp=new String [1000];
        public void startApp()
        {System.out.println("startApp");
         mForm=new Form("RSA Encryption");
         mCommandQuit=new Command("QUIT",Command.EXIT,0);
         mCommandItem=new Command("ENCRYPT",Command.ITEM,0);
         mForm.append("Enter text:\n");
         input=new TextField(null,"",100, TextField.ANY);
         mForm.append(input);
         mForm.append("Enter first prime number(p):\n");
         prime1=new TextField(null,"",100, TextField.ANY);
         mForm.append(prime1);
         mForm.append("Enter second prime number(q):\n");
         prime2=new TextField(null,"",100, TextField.ANY);
         mForm.append(prime2);
         mForm.append("Enter d:\n");
         prime3=new TextField(null,"",100, TextField.ANY);
         mForm.append(prime3);
         mForm.addCommand(mCommandQuit);
         mForm.addCommand(mCommandItem);
         mDisplay=Display.getDisplay(this);
         mDisplay.setCurrent(mForm);
         mForm.setCommandListener(this);
        public void pauseApp()
        {System.out.println("pauseApp");
        public void destroyApp(boolean unconditional)
        {System.out.println("destroyApp");
        public void commandAction(Command c, Displayable d)
        {System.out.println("commandAction");
         if(c==mCommandQuit)
            notifyDestroyed();
         else if(c==mCommandItem)
         {p = Integer.parseInt(prime1.getString());
             q = Integer.parseInt(prime2.getString());
             b = Integer.parseInt(prime3.getString());
             //breaking up of big string into ints
             mstring=input.getString();
             temp[0]="";
             for(i=1;i<mstring.length();i++)
                {if (mstring.charAt(i) == ' ')
                    {j++;
                     temp[j]="";
                 else
                    {temp[j]=temp[j]+mstring.charAt(i);
             mForm.append("\n\nThe array is:\n");
             for(i=0;i<temp.length && temp!=null;i++)
    {k1=Integer.parseInt(temp[i]); ***********************
    k2=k1;
    for(j=1;j<b;j++)
    {k1=k1*k2;
    k1=k1 %(p*q);
    k2=k1 %(p*q);
    a=a+new Character((char)k2).toString();
    output=new TextField(null,a,100, TextField.ANY);
    mForm.append(output);
    }hi
    this code basically takes an input of string like " 179 84 48 48 155 " (with spaces)
    then it creates smaller strings in an array like "179","84","48","48","155" without the spaces
    then it creates int values 179,84,48,48,155 and finally after some math functions it prints the corresponding letters.
    the problem is that it is not printing the letter because of some exceptions-->java.lang.NumberFormatException .it comes in the line where i have put stars
    could anybody please help me print the letters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    thanks for all ur help guys, but me and my team member solved it on our own. here is the new code:
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    public class Test3 extends MIDlet implements CommandListener
    {   Form mForm;
        Command mCommandQuit;
        Command mCommandItem;
        TextField input,prime1,prime2,prime3,output;
        Display mDisplay;
        int i,j=0,l,k1,k2,p,q,n,b;
        String mstring,a = "";
        String [] temp=new String [1000];
        public void startApp()
        {System.out.println("startApp");
         mForm=new Form("RSA Encryption");
         mCommandQuit=new Command("QUIT",Command.EXIT,0);
         mCommandItem=new Command("DECRYPT",Command.ITEM,0);
         mForm.append("Enter text:\n");
         input=new TextField(null,"",100, TextField.ANY);
         mForm.append(input);
         mForm.append("Enter first prime number(p):\n");
         prime1=new TextField(null,"",100, TextField.NUMERIC);
         mForm.append(prime1);
         mForm.append("Enter second prime number(q):\n");
         prime2=new TextField(null,"",100, TextField.NUMERIC);
         mForm.append(prime2);
         mForm.append("Enter d:\n");
         prime3=new TextField(null,"",100, TextField.NUMERIC);
         mForm.append(prime3);
         mForm.addCommand(mCommandQuit);
         mForm.addCommand(mCommandItem);
         mDisplay=Display.getDisplay(this);
         mDisplay.setCurrent(mForm);
         mForm.setCommandListener(this);
        public void pauseApp()
        {System.out.println("pauseApp");
        public void destroyApp(boolean unconditional)
        {System.out.println("destroyApp");
        public void commandAction(Command c, Displayable d)
        {System.out.println("commandAction");
         if(c==mCommandQuit)
            notifyDestroyed();
         else if(c==mCommandItem)
         {p = Integer.parseInt(prime1.getString());
             q = Integer.parseInt(prime2.getString());
             b = Integer.parseInt(prime3.getString());
             n=p*q;
             //breaking up of big string into ints
             mstring=input.getString();
             temp[0]="";
             for(i=1;i<mstring.length();i++)
                {if (mstring.charAt(i) == ' ')
                    {j++;
                     temp[j]="";
                 else
                    {temp[j]=temp[j]+mstring.charAt(i);
             l=j;
             mForm.append("\n\nThe result is:\n");
             for(i=0;i<l;i++)
                {k1=Integer.valueOf(temp).intValue();
    k2=k1;
    for(j=1;j<b;j++)
    {k2=k2*k1;
    k2=k2 %n;
    k1=k2 %n;
    a=a+new Character((char)k1).toString();
    output=new TextField(null,a,100, TextField.ANY);
    mForm.append(output);

  • Convert a string into a colour: HELP please

    I have a JComboBox which gives a Color selection (String) and i want to convert the selected string into a color so that i can call:
    Private void setColor(Color color)
    colorname = color;
    repaint();
    }any ideas?

    I have a class similar to the one shown in the previous post. Not wishing to be redundant, I am listing the class only to show other color constants that could be used in your application.
    I also am inclined to suggest using the JColorChooser widget.
    public class NamedColor
    public static final NamedColor[] HTML_COLORS = {
    new NamedColor("Snow", new Color(255, 250, 250)) //#FFFAFA
    , new NamedColor("GhostWhite", new Color(248, 248, 255)) //#F8F8FF
    , new NamedColor("WhiteSmoke", new Color(245, 245, 245)) //#F5F5F5
    , new NamedColor("Gainsboro", new Color(220, 220, 220)) //#DCDCDC
    , new NamedColor("FloralWhite", new Color(255, 250, 240)) //#FFFAF0
    , new NamedColor("OldLace", new Color(253, 245, 230)) //#FDF5E6
    , new NamedColor("Linen", new Color(250, 240, 230)) //#FAF0E6
    , new NamedColor("AntiqueWhite", new Color(250, 235, 215)) //#FAEBD7
    , new NamedColor("PapayaWhip", new Color(255, 239, 213)) //#FFEFD5
    , new NamedColor("BlanchedAlmond", new Color(255, 235, 205)) //#FFEBCD
    , new NamedColor("Bisque", new Color(255, 228, 196)) //#FFE4C4
    , new NamedColor("PeachPuff", new Color(255, 218, 185)) //#FFDAB9
    , new NamedColor("NavajoWhite", new Color(255, 222, 173)) //#FFDEAD
    , new NamedColor("Moccasin", new Color(255, 228, 181)) //#FFE4B5
    , new NamedColor("Cornsilk", new Color(255, 248, 220)) //#FFF8DC
    , new NamedColor("Ivory", new Color(255, 255, 240)) //#FFFFF0
    , new NamedColor("LemonChiffon", new Color(255, 250, 205)) //#FFFACD
    , new NamedColor("Seashell", new Color(255, 245, 238)) //#FFF5EE
    , new NamedColor("Honeydew", new Color(240, 255, 240)) //#F0FFF0
    , new NamedColor("MintCream", new Color(245, 255, 250)) //#F5FFFA
    , new NamedColor("Azure", new Color(240, 255, 255)) //#F0FFFF
    , new NamedColor("AliceBlue", new Color(240, 248, 255)) //#F0F8FF
    , new NamedColor("lavender", new Color(230, 230, 250)) //#E6E6FA
    , new NamedColor("LavenderBlush", new Color(255, 240, 245)) //#FFF0F5
    , new NamedColor("MistyRose", new Color(255, 228, 225)) //#FFE4E1
    , new NamedColor("White", new Color(255, 255, 255)) //#FFFFFF
    , new NamedColor("Black", new Color(0, 0, 0)) //#000000
    , new NamedColor("DarkSlateGray", new Color(47, 79, 79)) //#2F4F4F
    , new NamedColor("DimGrey", new Color(105, 105, 105)) //#696969
    , new NamedColor("SlateGrey", new Color(112, 128, 144)) //#708090
    , new NamedColor("LightSlateGray", new Color(119, 136, 153)) //#778899
    , new NamedColor("Grey", new Color(190, 190, 190)) //#BEBEBE
    , new NamedColor("LightGray", new Color(211, 211, 211)) //#D3D3D3
    , new NamedColor("MidnightBlue", new Color(25, 25, 112)) //#191970
    , new NamedColor("NavyBlue", new Color(0, 0, 128)) //#000080
    , new NamedColor("CornflowerBlue", new Color(100, 149, 237)) //#6495ED
    , new NamedColor("DarkSlateBlue", new Color(72, 61, 139)) //#483D8B
    , new NamedColor("SlateBlue", new Color(106, 90, 205)) //#6A5ACD
    , new NamedColor("MediumSlateBlue", new Color(123, 104, 238)) //#7B68EE
    , new NamedColor("LightSlateBlue", new Color(132, 112, 255)) //#8470FF
    , new NamedColor("MediumBlue", new Color(0, 0, 205)) //#0000CD
    , new NamedColor("RoyalBlue", new Color(65, 105, 225)) //#4169E1
    , new NamedColor("Blue", new Color(0, 0, 255)) //#0000FF
    , new NamedColor("DodgerBlue", new Color(30, 144, 255)) //#1E90FF
    , new NamedColor("DeepSkyBlue", new Color(0, 191, 255)) //#00BFFF
    , new NamedColor("SkyBlue", new Color(135, 206, 235)) //#87CEEB
    , new NamedColor("LightSkyBlue", new Color(135, 206, 250)) //#87CEFA
    , new NamedColor("SteelBlue", new Color(70, 130, 180)) //#4682B4
    , new NamedColor("LightSteelBlue", new Color(176, 196, 222)) //#B0C4DE
    , new NamedColor("LightBlue", new Color(173, 216, 230)) //#ADD8E6
    , new NamedColor("PowderBlue", new Color(176, 224, 230)) //#B0E0E6
    , new NamedColor("PaleTurquoise", new Color(175, 238, 238)) //#AFEEEE
    , new NamedColor("DarkTurquoise", new Color(0, 206, 209)) //#00CED1
    , new NamedColor("MediumTurquoise", new Color(72, 209, 204)) //#48D1CC
    , new NamedColor("Turquoise", new Color(64, 224, 208)) //#40E0D0
    , new NamedColor("Cyan", new Color(0, 255, 255)) //#00FFFF
    , new NamedColor("LightCyan", new Color(224, 255, 255)) //#E0FFFF
    , new NamedColor("CadetBlue", new Color(95, 158, 160)) //#5F9EA0
    , new NamedColor("MediumAquamarine", new Color(102, 205, 170)) //#66CDAA
    , new NamedColor("Aquamarine", new Color(127, 255, 212)) //#7FFFD4
    , new NamedColor("DarkGreen", new Color(0, 100, 0)) //#006400
    , new NamedColor("DarkOliveGreen", new Color(85, 107, 47)) //#556B2F
    , new NamedColor("DarkSeaGreen", new Color(143, 188, 143)) //#8FBC8F
    , new NamedColor("SeaGreen", new Color(46, 139, 87)) //#2E8B57
    , new NamedColor("MediumSeaGreen", new Color(60, 179, 113)) //#3CB371
    , new NamedColor("LightSeaGreen", new Color(32, 178, 170)) //#20B2AA
    , new NamedColor("PaleGreen", new Color(152, 251, 152)) //#98FB98
    , new NamedColor("SpringGreen", new Color(0, 255, 127)) //#00FF7F
    , new NamedColor("LawnGreen", new Color(124, 252, 0)) //#7CFC00
    , new NamedColor("Green", new Color(0, 255, 0)) //#00FF00
    , new NamedColor("Chartreuse", new Color(127, 255, 0)) //#7FFF00
    , new NamedColor("MedSpringGreen", new Color(0, 250, 154)) //#00FA9A
    , new NamedColor("GreenYellow", new Color(173, 255, 47)) //#ADFF2F
    , new NamedColor("LimeGreen", new Color(50, 205, 50)) //#32CD32
    , new NamedColor("YellowGreen", new Color(154, 205, 50)) //#9ACD32
    , new NamedColor("ForestGreen", new Color(34, 139, 34)) //#228B22
    , new NamedColor("OliveDrab", new Color(107, 142, 35)) //#6B8E23
    , new NamedColor("DarkKhaki", new Color(189, 183, 107)) //#BDB76B
    , new NamedColor("PaleGoldenrod", new Color(238, 232, 170)) //#EEE8AA
    , new NamedColor("LtGoldenrodYello", new Color(250, 250, 210)) //#FAFAD2
    , new NamedColor("LightYellow", new Color(255, 255, 224)) //#FFFFE0
    , new NamedColor("Yellow", new Color(255, 255, 0)) //#FFFF00
    , new NamedColor("Gold", new Color(255, 215, 0)) //#FFD700
    , new NamedColor("LightGoldenrod", new Color(238, 221, 130)) //#EEDD82
    , new NamedColor("goldenrod", new Color(218, 165, 32)) //#DAA520
    , new NamedColor("DarkGoldenrod", new Color(184, 134, 11)) //#B8860B
    , new NamedColor("RosyBrown", new Color(188, 143, 143)) //#BC8F8F
    , new NamedColor("IndianRed", new Color(205, 92, 92)) //#CD5C5C
    , new NamedColor("SaddleBrown", new Color(139, 69, 19)) //#8B4513
    , new NamedColor("Sienna", new Color(160, 82, 45)) //#A0522D
    , new NamedColor("Peru", new Color(205, 133, 63)) //#CD853F
    , new NamedColor("Burlywood", new Color(222, 184, 135)) //#DEB887
    , new NamedColor("Beige", new Color(245, 245, 220)) //#F5F5DC
    , new NamedColor("Wheat", new Color(245, 222, 179)) //#F5DEB3
    , new NamedColor("SandyBrown", new Color(244, 164, 96)) //#F4A460
    , new NamedColor("Tan", new Color(210, 180, 140)) //#D2B48C
    , new NamedColor("Chocolate", new Color(210, 105, 30)) //#D2691E
    , new NamedColor("Firebrick", new Color(178, 34, 34)) //#B22222
    , new NamedColor("Brown", new Color(165, 42, 42)) //#A52A2A
    , new NamedColor("DarkSalmon", new Color(233, 150, 122)) //#E9967A
    , new NamedColor("Salmon", new Color(250, 128, 114)) //#FA8072
    , new NamedColor("LightSalmon", new Color(255, 160, 122)) //#FFA07A
    , new NamedColor("Orange", new Color(255, 165, 0)) //#FFA500
    , new NamedColor("DarkOrange", new Color(255, 140, 0)) //#FF8C00
    , new NamedColor("Coral", new Color(255, 127, 80)) //#FF7F50
    , new NamedColor("LightCoral", new Color(240, 128, 128)) //#F08080
    , new NamedColor("Tomato", new Color(255, 99, 71)) //#FF6347
    , new NamedColor("OrangeRed", new Color(255, 69, 0)) //#FF4500
    , new NamedColor("Red", new Color(255, 0, 0)) //#FF0000
    , new NamedColor("HotPink", new Color(255, 105, 180)) //#FF69B4
    , new NamedColor("DeepPink", new Color(255, 20, 147)) //#FF1493
    , new NamedColor("Pink", new Color(255, 192, 203)) //#FFC0CB
    , new NamedColor("LightPink", new Color(255, 182, 193)) //#FFB6C1
    , new NamedColor("PaleVioletRed", new Color(219, 112, 147)) //#DB7093
    , new NamedColor("Maroon", new Color(176, 48, 96)) //#B03060
    , new NamedColor("MediumVioletRed", new Color(199, 21, 133)) //#C71585
    , new NamedColor("VioletRed", new Color(208, 32, 144)) //#D02090
    , new NamedColor("Magenta", new Color(255, 0, 255)) //#FF00FF
    , new NamedColor("Violet", new Color(238, 130, 238)) //#EE82EE
    , new NamedColor("Plum", new Color(221, 160, 221)) //#DDA0DD
    , new NamedColor("Orchid", new Color(218, 112, 214)) //#DA70D6
    , new NamedColor("MediumOrchid", new Color(186, 85, 211)) //#BA55D3
    , new NamedColor("DarkOrchid", new Color(153, 50, 204)) //#9932CC
    , new NamedColor("DarkViolet", new Color(148, 0, 211)) //#9400D3
    , new NamedColor("BlueViolet", new Color(138, 43, 226)) //#8A2BE2
    , new NamedColor("Purple", new Color(160, 32, 240)) //#A020F0
    , new NamedColor("MediumPurple", new Color(147, 112, 219)) //#9370DB
    , new NamedColor("Thistle", new Color(216, 191, 216)) //#D8BFD8
    , new NamedColor("Snow1", new Color(255, 250, 250)) //#FFFAFA
    , new NamedColor("Snow2", new Color(238, 233, 233)) //#EEE9E9
    , new NamedColor("Snow3", new Color(205, 201, 201)) //#CDC9C9
    , new NamedColor("Snow4", new Color(139, 137, 137)) //#8B8989
    , new NamedColor("Seashell1", new Color(255, 245, 238)) //#FFF5EE
    , new NamedColor("Seashell2", new Color(238, 229, 222)) //#EEE5DE
    , new NamedColor("Seashell3", new Color(205, 197, 191)) //#CDC5BF
    , new NamedColor("Seashell4", new Color(139, 134, 130)) //#8B8682
    , new NamedColor("AntiqueWhite1", new Color(255, 239, 219)) //#FFEFDB
    , new NamedColor("AntiqueWhite2", new Color(238, 223, 204)) //#EEDFCC
    , new NamedColor("AntiqueWhite3", new Color(205, 192, 176)) //#CDC0B0
    , new NamedColor("AntiqueWhite4", new Color(139, 131, 120)) //#8B8378
    , new NamedColor("Bisque1", new Color(255, 228, 196)) //#FFE4C4
    , new NamedColor("Bisque2", new Color(238, 213, 183)) //#EED5B7
    , new NamedColor("Bisque3", new Color(205, 183, 158)) //#CDB79E
    , new NamedColor("Bisque4", new Color(139, 125, 107)) //#8B7D6B
    , new NamedColor("PeachPuff1", new Color(255, 218, 185)) //#FFDAB9
    , new NamedColor("PeachPuff2", new Color(238, 203, 173)) //#EECBAD
    , new NamedColor("PeachPuff3", new Color(205, 175, 149)) //#CDAF95
    , new NamedColor("PeachPuff4", new Color(139, 119, 101)) //#8B7765
    , new NamedColor("NavajoWhite1", new Color(255, 222, 173)) //#FFDEAD
    , new NamedColor("NavajoWhite2", new Color(238, 207, 161)) //#EECFA1
    , new NamedColor("NavajoWhite3", new Color(205, 179, 139)) //#CDB38B
    , new NamedColor("NavajoWhite4", new Color(139, 121, 94)) //#8B795E
    , new NamedColor("LemonChiffon1", new Color(255, 250, 205)) //#FFFACD
    , new NamedColor("LemonChiffon2", new Color(238, 233, 191)) //#EEE9BF
    , new NamedColor("LemonChiffon3", new Color(205, 201, 165)) //#CDC9A5
    , new NamedColor("LemonChiffon4", new Color(139, 137, 112)) //#8B8970
    , new NamedColor("Cornsilk1", new Color(255, 248, 220)) //#FFF8DC
    , new NamedColor("Cornsilk2", new Color(238, 232, 205)) //#EEE8CD
    , new NamedColor("Cornsilk3", new Color(205, 200, 177)) //#CDC8B1
    , new NamedColor("Cornsilk4", new Color(139, 136, 120)) //#8B8878
    , new NamedColor("Ivory1", new Color(255, 255, 240)) //#FFFFF0
    , new NamedColor("Ivory2", new Color(238, 238, 224)) //#EEEEE0
    , new NamedColor("Ivory3", new Color(205, 205, 193)) //#CDCDC1
    , new NamedColor("Ivory4", new Color(139, 139, 131)) //#8B8B83
    , new NamedColor("Honeydew1", new Color(240, 255, 240)) //#F0FFF0
    , new NamedColor("Honeydew2", new Color(224, 238, 224)) //#E0EEE0
    , new NamedColor("Honeydew3", new Color(193, 205, 193)) //#C1CDC1
    , new NamedColor("Honeydew4", new Color(131, 139, 131)) //#838B83
    , new NamedColor("LavenderBlush1", new Color(255, 240, 245)) //#FFF0F5
    , new NamedColor("LavenderBlush2", new Color(238, 224, 229)) //#EEE0E5
    , new NamedColor("LavenderBlush3", new Color(205, 193, 197)) //#CDC1C5
    , new NamedColor("LavenderBlush4", new Color(139, 131, 134)) //#8B8386
    , new NamedColor("MistyRose1", new Color(255, 228, 225)) //#FFE4E1
    , new NamedColor("MistyRose2", new Color(238, 213, 210)) //#EED5D2
    , new NamedColor("MistyRose3", new Color(205, 183, 181)) //#CDB7B5
    , new NamedColor("MistyRose4", new Color(139, 125, 123)) //#8B7D7B
    , new NamedColor("Azure1", new Color(240, 255, 255)) //#F0FFFF
    , new NamedColor("Azure2", new Color(224, 238, 238)) //#E0EEEE
    , new NamedColor("Azure3", new Color(193, 205, 205)) //#C1CDCD
    , new NamedColor("Azure4", new Color(131, 139, 139)) //#838B8B
    , new NamedColor("SlateBlue1", new Color(131, 111, 255)) //#836FFF
    , new NamedColor("SlateBlue2", new Color(122, 103, 238)) //#7A67EE
    , new NamedColor("SlateBlue3", new Color(105, 89, 205)) //#6959CD
    , new NamedColor("SlateBlue4", new Color(71, 60, 139)) //#473C8B
    , new NamedColor("RoyalBlue1", new Color(72, 118, 255)) //#4876FF
    , new NamedColor("RoyalBlue2", new Color(67, 110, 238)) //#436EEE
    , new NamedColor("RoyalBlue3", new Color(58, 95, 205)) //#3A5FCD
    , new NamedColor("RoyalBlue4", new Color(39, 64, 139)) //#27408B
    , new NamedColor("Blue1", new Color(0, 0, 255)) //#0000FF
    , new NamedColor("Blue2", new Color(0, 0, 238)) //#0000EE
    , new NamedColor("Blue3", new Color(0, 0, 205)) //#0000CD
    , new NamedColor("Blue4", new Color(0, 0, 139)) //#00008B
    , new NamedColor("DodgerBlue1", new Color(30, 144, 255)) //#1E90FF
    , new NamedColor("DodgerBlue2", new Color(28, 134, 238)) //#1C86EE
    , new NamedColor("DodgerBlue3", new Color(24, 116, 205)) //#1874CD
    , new NamedColor("DodgerBlue4", new Color(16, 78, 139)) //#104E8B
    , new NamedColor("SteelBlue1", new Color(99, 184, 255)) //#63B8FF
    , new NamedColor("SteelBlue2", new Color(92, 172, 238)) //#5CACEE
    , new NamedColor("SteelBlue3", new Color(79, 148, 205)) //#4F94CD
    , new NamedColor("SteelBlue4", new Color(54, 100, 139)) //#36648B
    , new NamedColor("DeepSkyBlue1", new Color(0, 191, 255)) //#00BFFF
    , new NamedColor("DeepSkyBlue2", new Color(0, 178, 238)) //#00B2EE
    , new NamedColor("DeepSkyBlue3", new Color(0, 154, 205)) //#009ACD
    , new NamedColor("DeepSkyBlue4", new Color(0, 104, 139)) //#00688B
    , new NamedColor("SkyBlue1", new Color(135, 206, 255)) //#87CEFF
    , new NamedColor("SkyBlue2", new Color(126, 192, 238)) //#7EC0EE
    , new NamedColor("SkyBlue3", new Color(108, 166, 205)) //#6CA6CD
    , new NamedColor("SkyBlue4", new Color(74, 112, 139)) //#4A708B
    , new NamedColor("LightSkyBlue1", new Color(176, 226, 255)) //#B0E2FF
    , new NamedColor("LightSkyBlue2", new Color(164, 211, 238)) //#A4D3EE
    , new NamedColor("LightSkyBlue3", new Color(141, 182, 205)) //#8DB6CD
    , new NamedColor("LightSkyBlue4", new Color(96, 123, 139)) //#607B8B
    , new NamedColor("SlateGray1", new Color(198, 226, 255)) //#C6E2FF
    , new NamedColor("SlateGray2", new Color(185, 211, 238)) //#B9D3EE
    , new NamedColor("SlateGray3", new Color(159, 182, 205)) //#9FB6CD
    , new NamedColor("SlateGray4", new Color(108, 123, 139)) //#6C7B8B
    , new NamedColor("LightSteelBlue1", new Color(202, 225, 255)) //#CAE1FF
    , new NamedColor("LightSteelBlue2", new Color(188, 210, 238)) //#BCD2EE
    , new NamedColor("LightSteelBlue3", new Color(162, 181, 205)) //#A2B5CD
    , new NamedColor("LightSteelBlue4", new Color(110, 123, 139)) //#6E7B8B
    , new NamedColor("LightBlue1", new Color(191, 239, 255)) //#BFEFFF
    , new NamedColor("LightBlue2", new Color(178, 223, 238)) //#B2DFEE
    , new NamedColor("LightBlue3", new Color(154, 192, 205)) //#9AC0CD
    , new NamedColor("LightBlue4", new Color(104, 131, 139)) //#68838B
    , new NamedColor("LightCyan1", new Color(224, 255, 255)) //#E0FFFF
    , new NamedColor("LightCyan2", new Color(209, 238, 238)) //#D1EEEE
    , new NamedColor("LightCyan3", new Color(180, 205, 205)) //#B4CDCD
    , new NamedColor("LightCyan4", new Color(122, 139, 139)) //#7A8B8B
    , new NamedColor("PaleTurquoise1", new Color(187, 255, 255)) //#BBFFFF
    , new NamedColor("PaleTurquoise2", new Color(174, 238, 238)) //#AEEEEE
    , new NamedColor("PaleTurquoise3", new Color(150, 205, 205)) //#96CDCD
    , new NamedColor("PaleTurquoise4", new Color(102, 139, 139)) //#668B8B
    , new NamedColor("CadetBlue1", new Color(152, 245, 255)) //#98F5FF
    , new NamedColor("CadetBlue2", new Color(142, 229, 238)) //#8EE5EE
    , new NamedColor("CadetBlue3", new Color(122, 197, 205)) //#7AC5CD
    , new NamedColor("CadetBlue4", new Color(83, 134, 139)) //#53868B
    , new NamedColor("Turquoise1", new Color(0, 245, 255)) //#00F5FF
    , new NamedColor("Turquoise2", new Color(0, 229, 238)) //#00E5EE
    , new NamedColor("Turquoise3", new Color(0, 197, 205)) //#00C5CD
    , new NamedColor("Turquoise4", new Color(0, 134, 139)) //#00868B
    , new NamedColor("Cyan1", new Color(0, 255, 255)) //#00FFFF
    , new NamedColor("Cyan2", new Color(0, 238, 238)) //#00EEEE
    , new NamedColor("Cyan3", new Color(0, 205, 205)) //#00CDCD
    , new NamedColor("Cyan4", new Color(0, 139, 139)) //#008B8B
    , new NamedColor("DarkSlateGray1", new Color(151, 255, 255)) //#97FFFF
    , new NamedColor("DarkSlateGray2", new Color(141, 238, 238)) //#8DEEEE
    , new NamedColor("DarkSlateGray3", new Color(121, 205, 205)) //#79CDCD
    , new NamedColor("DarkSlateGray4", new Color(82, 139, 139)) //#528B8B
    , new NamedColor("Aquamarine1", new Color(127, 255, 212)) //#7FFFD4
    , new NamedColor("Aquamarine2", new Color(118, 238, 198)) //#76EEC6
    , new NamedColor("Aquamarine3", new Color(102, 205, 170)) //#66CDAA
    , new NamedColor("Aquamarine4", new Color(69, 139, 116)) //#458B74
    , new NamedColor("DarkSeaGreen1", new Color(193, 255, 193)) //#C1FFC1
    , new NamedColor("DarkSeaGreen2", new Color(180, 238, 180)) //#B4EEB4
    , new NamedColor("DarkSeaGreen3", new Color(155, 205, 155)) //#9BCD9B
    , new NamedColor("DarkSeaGreen4", new Color(105, 139, 105)) //#698B69
    , new NamedColor("SeaGreen1", new Color(84, 255, 159)) //#54FF9F
    , new NamedColor("SeaGreen2", new Color(78, 238, 148)) //#4EEE94
    , new NamedColor("SeaGreen3", new Color(67, 205, 128)) //#43CD80
    , new NamedColor("SeaGreen4", new Color(46, 139, 87)) //#2E8B57
    , new NamedColor("PaleGreen1", new Color(154, 255, 154)) //#9AFF9A
    , new NamedColor("PaleGreen2", new Color(144, 238, 144)) //#90EE90
    , new NamedColor("PaleGreen3", new Color(124, 205, 124)) //#7CCD7C
    , new NamedColor("PaleGreen4", new Color(84, 139, 84)) //#548B54
    , new NamedColor("SpringGreen1", new Color(0, 255, 127)) //#00FF7F
    , new NamedColor("SpringGreen2", new Color(0, 238, 118)) //#00EE76
    , new NamedColor("SpringGreen3", new Color(0, 205, 102)) //#00CD66
    , new NamedColor("SpringGreen4", new Color(0, 139, 69)) //#008B45
    , new NamedColor("Green1", new Color(0, 255, 0)) //#00FF00
    , new NamedColor("Green2", new Color(0, 238, 0)) //#00EE00
    , new NamedColor("Green3", new Color(0, 205, 0)) //#00CD00
    , new NamedColor("Green4", new Color(0, 139, 0)) //#008B00
    , new NamedColor("Chartreuse1", new Color(127, 255, 0)) //#7FFF00
    , new NamedColor("Chartreuse2", new Color(118, 238, 0)) //#76EE00
    , new NamedColor("Chartreuse3", new Color(102, 205, 0)) //#66CD00
    , new NamedColor("Chartreuse4", new Color(69, 139, 0)) //#458B00
    , new NamedColor("OliveDrab1", new Color(192, 255, 62)) //#C0FF3E
    , new NamedColor("OliveDrab2", new Color(179, 238, 58)) //#B3EE3A
    , new NamedColor("OliveDrab3", new Color(154, 205, 50)) //#9ACD32
    , new NamedColor("OliveDrab4", new Color(105, 139, 34)) //#698B22
    , new NamedColor("DarkOliveGreen1", new Color(202, 255, 112)) //#CAFF70
    , new NamedColor("DarkOliveGreen2", new Color(188, 238, 104)) //#BCEE68
    , new NamedColor("DarkOliveGreen3", new Color(162, 205, 90)) //#A2CD5A
    , new NamedColor("DarkOliveGreen4", new Color(110, 139, 61)) //#6E8B3D
    , new NamedColor("Khaki1", new Color(255, 246, 143)) //#FFF68F
    , new NamedColor("Khaki2", new Color(238, 230, 133)) //#EEE685
    , new NamedColor("Khaki3", new Color(205, 198, 115)) //#CDC673
    , new NamedColor("Khaki4", new Color(139, 134, 78)) //#8B864E
    , new NamedColor("LightGoldenrod1", new Color(255, 236, 139)) //#FFEC8B
    , new NamedColor("LightGoldenrod2", new Color(238, 220, 130)) //#EEDC82
    , new NamedColor("LightGoldenrod3", new Color(205, 190, 112)) //#CDBE70
    , new NamedColor("LightGoldenrod4", new Color(139, 129, 76)) //#8B814C
    , new NamedColor("LightYellow1", new Color(255, 255, 224)) //#FFFFE0
    , new NamedColor("LightYellow2", new Color(238, 238, 209)) //#EEEED1
    , new NamedColor("LightYellow3", new Color(205, 205, 180)) //#CDCDB4
    , new NamedColor("LightYellow4", new Color(139, 139, 122)) //#8B8B7A
    , new NamedColor("Yellow1", new Color(255, 255, 0)) //#FFFF00
    , new NamedColor("Yellow2", new Color(238, 238, 0)) //#EEEE00
    , new NamedColor("Yellow3", new Color(205, 205, 0)) //#CDCD00
    , new NamedColor("Yellow4", new Color(139, 139, 0)) //#8B8B00
    , new NamedColor("Gold1", new Color(255, 215, 0)) //#FFD700
    , new NamedColor("Gold2", new Color(238, 201, 0)) //#EEC900
    , new NamedColor("Gold3", new Color(205, 173, 0)) //#CDAD00
    , new NamedColor("Gold4", new Color(139, 117, 0)) //#8B7500
    , new NamedColor("Goldenrod1", new Color(255, 193, 37)) //#FFC125
    , new NamedColor("Goldenrod2", new Color(238, 180, 34)) //#EEB422
    , new NamedColor("Goldenrod3", new Color(205, 155, 29)) //#CD9B1D
    , new NamedColor("Goldenrod4", new Color(139, 105, 20)) //#8B6914
    , new NamedColor("DarkGoldenrod1", new Color(255, 185, 15)) //#FFB90F
    , new NamedColor("DarkGoldenrod2", new Color(238, 173, 14)) //#EEAD0E
    , new NamedColor("DarkGoldenrod3", new Color(205, 149, 12)) //#CD950C
    , new NamedColor("DarkGoldenrod4", new Color(139, 101, 8)) //#8B658B
    , new NamedColor("RosyBrown1", new Color(255, 193, 193)) //#FFC1C1
    , new NamedColor("RosyBrown2", new Color(238, 180, 180)) //#EEB4B4
    , new NamedColor("RosyBrown3", new Color(205, 155, 155)) //#CD9B9B
    , new NamedColor("RosyBrown4", new Color(139, 105, 105)) //#8B6969
    , new NamedColor("IndianRed1", new Color(255, 106, 106)) //#FF6A6A
    , new NamedColor("IndianRed2", new Color(238, 99, 99)) //#EE6363
    , new NamedColor("IndianRed3", new Color(205, 85, 85)) //#CD5555
    , new NamedColor("IndianRed4", new Color(139, 58, 58)) //#8B3A3A
    , new NamedColor("Sienna1", new Color(255, 130, 71)) //#FF8247
    , new NamedColor("Sienna2", new Color(238, 121, 66)) //#EE7942
    , new NamedColor("Sienna3", new Color(205, 104, 57)) //#CD6839
    , new NamedColor("Sienna4", new Color(139, 71, 38)) //#8B4726
    , new NamedColor("Burlywood1", new Color(255, 211, 155)) //#FFD39B
    , new NamedColor("Burlywood2", new Color(238, 197, 145)) //#EEC591
    , new NamedColor("Burlywood3", new Color(205, 170, 125)) //#CDAA7D
    , new NamedColor("Burlywood4", new Color(139, 115, 85)) //#8B7355
    , new NamedColor("Wheat1", new Color(255, 231, 186)) //#FFE7BA
    , new NamedColor("Wheat2", new Color(238, 216, 174)) //#EED8AE
    , new NamedColor("Wheat3", new Color(205, 186, 150)) //#CDBA96
    , new NamedColor("Wheat4", new Color(139, 126, 102)) //#8B7E66
    , new NamedColor("Tan1", new Color(255, 165, 79)) //#FFA54F
    , new NamedColor("Tan2", new Color(238, 154, 73)) //#EE9A49
    , new NamedColor("Tan3", new Color(205, 133, 63)) //#CD853F
    , new NamedColor("Tan4", new Color(139, 90, 43)) //#8B5A2B
    , new NamedColor("Chocolate1", new Color(255, 127, 36)) //#FF7F24
    , new NamedColor("Chocolate2", new Color(238, 118, 33)) //#EE7621
    , new NamedColor("Chocolate3", new Color(205, 102, 29)) //#CD661D
    , new NamedColor("Chocolate4", new Color(139, 69, 19)) //#8B4513
    , new NamedColor("Firebrick1", new Color(255, 48, 48)) //#FF3030
    , new NamedColor("Firebrick2", new Color(238, 44, 44)) //#EE2C2C
    , new NamedColor("Firebrick3", new Color(205, 38, 38)) //#CD2626
    , new NamedColor("Firebrick4", new Color(139, 26, 26)) //#8B1A1A
    , new NamedColor("Brown1", new Color(255, 64, 64)) //#FF4040
    , new NamedColor("Brown2", new Color(238, 59, 59)) //#EE3B3B
    , new NamedColor("Brown3", new Color(205, 51, 51)) //#CD3333
    , new NamedColor("Brown4", new Color(139, 35, 35)) //#8B2323
    , new NamedColor("Salmon1", new Color(255, 140, 105)) //#FF8C69
    , new NamedColor("Salmon2", new Color(238, 130, 98)) //#EE8262
    , new NamedColor("Salmon3", new Color(205, 112, 84)) //#CD7054
    , new NamedColor("Salmon4", new Color(139, 76, 57)) //#8B4C39
    , new NamedColor("LightSalmon1", new Color(255, 160, 122)) //#FFA07A
    , new NamedColor("LightSalmon2", new Color(238, 149, 114)) //#EE9572
    , new NamedColor("LightSalmon3", new Color(205, 129, 98)) //#CD8162
    , new NamedColor("LightSalmon4", new Color(139, 87, 66)) //#8B5742
    , new NamedColor("Orange1", new Color(255, 165, 0)) //#FFA500
    , new NamedColor("Orange2", new Color(238, 154, 0)) //#EE9A00
    , new NamedColor("Orange3", new Color(205, 133, 0)) //#CD8500
    , new NamedColor("Orange4", new Color(139, 90, 0)) //#8B5A00
    , new NamedColor("DarkOrange1", new Color(255, 127, 0)) //#FF7F00
    , new NamedColor("DarkOrange2", new Color(238, 118, 0)) //#EE7600
    , new NamedColor("DarkOrange3", new Color(205, 102, 0)) //#CD6600
    , new NamedColor("DarkOrange4", new Color(139, 69, 0)) //#8B4500
    , new NamedColor("Coral1", new Color(255, 114, 86)) //#FF7256
    , new NamedColor("Coral2", new Color(238, 106, 80)) //#EE6A50
    , new NamedColor("Coral3", new Color(205, 91, 69)) //#CD5B45
    , new NamedColor("Coral4", new Color(139, 62, 47)) //#8B3E2F
    , new NamedColor("Tomato1", new Color(255, 99, 71)) //#FF6347
    , new NamedColor("Tomato2", new Color(238, 92, 66)) //#EE5C42
    , new NamedColor("Tomato3", new Color(205, 79, 57)) //#CD4F39
    , new NamedColor("Tomato4", new Color(139, 54, 38)) //#8B3626
    , new NamedColor("OrangeRed1", new Color(255, 69, 0)) //#FF4500
    , new NamedColor("OrangeRed2", new Color(238, 64, 0)) //#EE4000
    , new NamedColor("OrangeRed3", new Color(205, 55, 0)) //#CD3700
    , new NamedColor("OrangeRed4", new Color(139, 37, 0)) //#8B2500
    , new NamedColor("Red1", new Color(255, 0, 0)) //#FF0000
    , new NamedColor("Red2", new Color(238, 0, 0)) //#EE0000
    , new NamedColor("Red3", new Color(205, 0, 0)) //#CD0000
    , new NamedColor("Red4", new Color(139, 0, 0)) //#8B0000
    , new NamedColor("DeepPink1", new Color(255, 20, 147)) //#FF1493
    , new NamedColor("DeepPink2", new Color(238, 18, 137)) //#EE1289
    , new NamedColor("DeepPink3", new Color(205, 1

  • "Conversion to String failed"  When attempting to call rs.getString()

    Hello All,
    I'm getting a "Conversion to String failed" exception being thrown from oracle jdbc when I attempting to call the rs.getString(1) method on a column type of DATE.
    During investigations we've found the following:
    1. The query is fine, and is performing a "select * from table".
    2. I see this problem when using 9i database (v 9.2.0.7) with 9i jdbc drivers (v9.2.0.7).
    3. Strangely enough, if I use 10g jdbc drivers with the 9i database this problem goes away, and naturally I don't see this problem at all using a 10g driver working against a 10g database.
    4. Grabbing the DATE value using the getDate() instead of getString() API works just fine in 9i.
    5. The 9i rs.getString() API call will work with some date values in the database and not with others.
    6. The data placed into the DATE column in question could have been placed there using different driver type from the 9i.
    So, the 9i getString() API seems to be a problem.
    At this point, based upon points 5 and 6 above, I'm thinking there is a bug in the oracle 9i jdbc drivers that is unable to convert DATE type data using the getString() API if the data was initially placed into the database using a different driver type. But, this would mean that the format of the data in the database would be different depending upon the means of getting the data there in the first place (which doesn't make much sense).
    Here is the pertinent Stack Trace:
    java.sql.SQLException: Conversion to String failed
    at oracle.sql.Datum.stringValue(Datum.java:173)
    at oracle.jdbc.driver.ScrollableResultSet.getString(ScrollableResultSet.java:684)
    at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1549)
    at com.revenuesolutionsinc.dali.sql.DALResultSet.getString(DALResultSet.java:325)
    Any help on this matter would be greatly appreciated.
    Thanks,
    Doug Newcomb

    Doug,
    Pardon me for stating the obvious, but is there a
    reason why you cannot use method "getDate()" instead
    of method "getString()"?
    For your information, you can report bugs via the
    MetaLink
    Web site.
    Good Luck,
    Avi.Thanks for the reply Avi,
    The main reason is that we've got mountains of code that would need to be refactored. Also, the getString() method worked fine for over a year.
    So we are looking towards finding out why this is happening before making the decision to refactor.
    I will be placing a TAR with Oracle on Monday, but I thought I'd try to find out if anyone else has run into a similar problem.

  • String into date format

    Hi
    I was wondering if anyone knew how to convert a string into different formats,
    to enable it to be stored in a mysql db.
    I was wondering anyone you knew how to convert:
    - String into the date format yyyy-mm--dd
    - String into time format 00:00:00
    - string to double
    Ive tried:
    c_date = java.sql.Date.valueOf(f_date);
    System.out.println("conversion data: " +c_date);
    c_time = java.sql.Time.valueOf(f_time);
    System.out.println(" time converted data: "+c_time);
    // string to double conversion
    c_change = java.lang.Double.valueOf(f_change);
    System.out.println(c_change);
    My class doesnt execute this at all?
    Also,
    SimpleDateFormat sdft = new SimpleDateFormat("yyyy-MM-dd");
    c_date = sdft.format(f_date);
    System.out.println(c_date);
    .. but this method returns the error incompatible types?
    Any suggestions would be helpful.. thanks in advance..

    Friends i've got similar kind of problem...can you help me
    here is my code. When i try to print the user entered date (dd/MM/yyyy)(which i am storing in a string) the program dispalys nothing. and everey time i enter a valid date it displas "invalid From date entered ". I need to store the user entered date into a string because i need that for further use. All my intesion is to get two dates from user in dd/MM/yyyy. Strore them in certain variable. Check if they are valid or not. and make sure todate is either equal or greater than fromdate. Please help me to solve this problem.
    public class EDTDateValidation extends JFrame implements ActionListener{
    private JLabel fromlabel;
    private JLabel tolabel;
    private JTextField fromtxt;
    private JTextField totxt;
    private String fmt ="dd/MM/yyyy";
    private java.lang.String fromdate;
    private java.lang.String todate;
    private JButton buttonOK;
    private JButton buttonCancel;
    private Date theDate;
    private Date date1;
    private Date date2;
    private JPanel mainPanel;
    SimpleDateFormat dtformat = new SimpleDateFormat(fmt);
    public EDTDateValidation(){
    super("Date Validation");
    dtformat.setLenient(false);
    mainPanel=new JPanel();
    mainPanel.setLayout(null);
    fromlabel = new JLabel("From Date");
    tolabel = new JLabel("To Date");
    buttonOK = new JButton("OK");
    buttonCancel = new JButton("Cancel");
    fromdate = new String();
    todate = new String();
    fromtxt = new JTextField(10);
    totxt = new JTextField(10);
    fromdate = fromtxt.getText();
    todate = totxt.getText();
    mainPanel.add(fromlabel);
    fromlabel.setBounds(20,20,50,15);
    mainPanel.add(tolabel);
    tolabel.setBounds(20,50,50,15);
    mainPanel.add(fromtxt);
    fromtxt.setBounds(90,20,130,20);
    mainPanel.add(totxt);
    totxt. setBounds(90,50,130,20);
    mainPanel.add(buttonOK);
    buttonOK.setBounds(70,80,71,23);
    mainPanel.add(buttonCancel);
    buttonCancel.setBounds(150,80,71,23);
    buttonOK.addActionListener(this);
    buttonCancel.addActionListener(this);
    setContentPane(mainPanel);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setSize(247,140);
    setResizable(false);
    //pack();
    public static void main(String args[]) {
    try {
    UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
    catch(Exception e) {
    System.err.println("Could not load Look and Feel" + e);
    EDTDateValidation edtDateVal = new EDTDateValidation();
    edtDateVal.setVisible(true);
    public void actionPerformed(ActionEvent e) {
    if(e.getSource() == buttonOK){
    System.out.println(fromtxt.getText());
    System.out.println(fromdate); //THIS PRINTS BLANK
    System.out.println(todate); //THIS ASWELL
    try {
    Date date = null;
    date = dtformat.parse(fromdate);
    System.out.println("valid From date entered!");
    catch(Exception f) {
    System.out.println("Invalid From date entered!");
    // textField1.setText("");
    return;
    try {
    Date date = null;
    date = dtformat.parse(todate);
    System.out.println("valid TO date entered!");
    catch(Exception f) {
    System.out.println("Invalid To date entered!");
    // textField1.setText("");
    return;
    }

  • Conversion from string "" to type 'Double' is not valid

    We're using BPC 7.5 MS and on patch level 111.02
    There's two front-end servers and one back-end.  we have about 100 users but concurrency is likely in the 50 range.
    We've been running extremely well for about 4 years but are now starting to run into problems.
    There are about 5-6 applications but none greater than 10 million records.  We optimize regularly.
    However over the past two months admin processes seem to take a lot longer.  Optimization now times out after about 1.25 hours and none used to take greater than 15 minutes.
    Today after processing dimensions we checked the application status and we were not able to check if it was available or not.  We got a pop up box saying
    conversion from string "" to type 'Double' is not valid
    I've processed dimensions and applications since and still this error persists.
    We're attempting a reboot to see if that helps but I've never seen this before and in combination with the slower admin processing I'm wondering if there's something drastic going to happen.
    Michael

    Hi Michael,
    for the poor performances you have to check the guides about performance on bpc if you have scheduled regurarly optimize during day and night (just verify that never factwb reach 50.000 and fac2 500.000 records) maybe you need to change some parameter on the server as MaxThreads.
    For the conversion string error on admin console see please this note 1803092 - Set application set status error
    Regards
         Roberto

  • Help with sending string using setRequestProperty to servlet

    I have a string that is encrpyted so it uses some wierd characters. An
    example of the integer representation of the characters for a string that is
    not working is:
    26,162,91,52,153,136,227,53,190,0
    When I recieve it on the servlet end and go to use it the integer
    representation of the characters is all messed up therefore I can't decrypt
    it properly. The servlet recieved:
    26,162,91,52, 63 , 63 ,227,53,190,0
    Where did the 63's come form??????? That is a "?" character and was not
    part of the original string. I think it has something to do with when the
    characters are converted to bytes or something but I can't seem to figure
    out a way to fix it so that I get the original characters...
    Please, any help would be very much appreciated. Thanks.

    Hmmm....my last post doesn't appear to make a whole lot of sense. I've got to start getting to bed earlier.
    I guess I was a little excited when I realized what URLEncoder and URLDecoder were doing (by looking at the source, of course) which involves a lot of char conversion on the individual portions of your String. These classes are for US-ASCII text and really don't handle non-printable characters very well.
    The passing of the characters across the connection remains a problem, and (without looking at source code) I believe the same problem is at the root; there is a basic encoding of your String into a format that doesn't support characters that aren't in the code page, and the question marks are substituted.
    I haven't tried, but can suggest, using the encode/decode methods in the javax.mail.internet.MimeUtility class. This class comes with the J2EE download, but I'm afraid it may have some of the same shortcomings when it comes to characters it doesn't like (its methods appear to be mostly for mail HEADERS.)
    You basically need either a UUEncode or Base64 encoder/decoder to translate your String into plaintext before it gets sent to the Servlet. The Java Commerce API (Java Wallet) contains a Base64Encoder/Base64Decoder but it is not licensed for reuse.
    There might be other options (I don't know the full scope of your setup), but if all else fails, I can post a UUEncode class that will convert your encrypted string into plaintext for transmission.

  • Conversion from string "20041023 " to type 'Date' is not valid.

    Hi ,
       I have a table with one of the column(EmpHiredate) datatype is char(10). It has value like "20141023". I need to display this value as date format(dd/mm/yyyy) in report. 
    Following methods i tried in textbox expression but no luck.
    =Format(Fields!EmpHireDate.Value,"dd/MM/yyyy")
    =Cdate(Fields!EmpHireDate.Value)
    Error:
    [rsRuntimeErrorInExpression] The Value expression for the textrun ‘EmpHireDate.Paragraphs[0].TextRuns[0]’ contains an error: Conversion from string "20041023  " to type 'Date' is not valid.
    Is it possible to convert string to date using SSRS textbox expression ? Can anyone help me with the solution.
    Thanks,
    Kittu

    Hi Jmcmullen,
         Found one more issue on the same. I have one value like "00000000" for the column(EmpHiredate)
    , when i use above expression values(ex:"20141023")
    are displaying in dd/MM/yyyy format in report except value like "00000000" and giving following error:
    [rsRuntimeErrorInExpression] The Value expression for the textrun ‘EmpHireDate.Paragraphs[0].TextRuns[0]’ contains an error: Conversion from string "0000/00/00" to type 'Date' is not valid.
    Even i tried to pass its original value("00000000") as below but no luck.
    =IIF(Fields!EmpHireDate.Value = "00000000","00000000",Format(CDATE(MID(Fields!EmpHireDate.Value,1,4) + "/" + MID(Fields!EmpHireDate.Value,5,2) + "/" + MID(Fields!EmpHireDate.Value,7,2)),"dd/MM/yyyy"))
    Also tried this:
    =IIF(Fields!EmpHireDate.Value = "00000000","2000/10/21",Format(CDATE(MID(Fields!EmpHireDate.Value,1,4) + "/" + MID(Fields!EmpHireDate.Value,5,2) + "/" + MID(Fields!EmpHireDate.Value,7,2)),"dd/MM/yyyy"))
    Please Suggest. 
    Thanks ,
    Kittu

  • How can I put a stl::vector string into the DB and then get it out?

    Hello,
    As the title, here's a test case with problems,but anyway you can still run it. ( VC6/XP-32/BDB 4.7 )
    I know this may be wrong,and I'd like to know how can I do this.
    Can someone help me please? I would appreciate it very much.
    ************ Copy,Compile and Run ***************
    #include <iostream>
    #include <vector>
    #include "db_cxx.h"
    int main()
         std::string dbName("database.db");
         u_int32_t db_flags=DB_CREATE;
         Db* db=NULL;
         // Prepare key(int)/data(vector<string>) pair.
         int int_key=2;
         std::vector<std::string> rec_data;
         rec_data.push_back("apple");
         rec_data.push_back("Bob");
         rec_data.push_back("Me");
         // Prepare Dbt for receiving.
         std::vector<std::string> rec_readData;
         Dbt readData;
         readData.set_data(&rec_readData);
         readData.set_ulen(sizeof(rec_readData));
         readData.set_flags(DB_DBT_USERMEM);
         try
              // Open database.
              db = new Db(NULL,0);
              db->open(NULL,dbName.c_str(),NULL,DB_BTREE,db_flags,0);
              // Put
              int ret;
              if(ret=db->put(NULL,new Dbt(&int_key,sizeof(int_key)),new Dbt(&rec_data,sizeof(rec_data)),DB_NOOVERWRITE)==0)
                   std::cout<<"put successful!"<<std::endl;
              else { db->err(ret,"Db->put"); }
              // Get
              if(ret=db->get(NULL,new Dbt(&int_key,sizeof(int_key)),&readData,0)==0)
                   std::cout<<"get successful!"<<std::endl;
              else { db->err(ret,"Db->get"); }
         catch(DbException &e)
              std::cerr<<"Error: ";
              std::cerr<<e.what()<<std::endl;
         // Close the database
         try
              if(db!=NULL)
                   db->close(0);
         catch(DbException &e)
              std::cerr<<"Error closing database: ";
              std::cerr<<e.what()<<std::endl;
         // Display the results.
         // Index out of bounds. <-----
         std::cout << rec_readData[0].c_str();
         std::cout << rec_readData[1].c_str();
         std::cout << rec_readData[2].c_str();
         system("pause");
         // Press any key to go wrong. :(
         return 0;
    Regards,
    legendsino

    You need to convert the std::vector<std::string> into a sequence of bytes. For example, if all strings are shorter than 256 characters, you could create a fresh output string, iterator through the vector, and for each element, append the string length to the output string, followed by the string contents.
    Note that ordering in the database will be different from lexicographic order, and you have to keep that in mind when performing range queries.

  • Issue with splitting string into multiple lines

    Hi Experts,
    I have a long string s. I want to split this string into several lines each having 72 characters. For this I have done following programming:
         String s = "For the first time it includes a supplementary report attempting to determine if extreme weather
    events can be linked to human-induced climate change. The research team, including members
    of the UK Met Office, identified recent episodes of extreme weather then used a computer to
    estimate the likelihood of the episode happening in a world without increased CO2." ;
         s = s.replaceAll("[\r\n]+", " ");
         char[] sAr = s.toCharArray();
         AbstractList RecepitsList7 = new Bapitrtext.Bapitrtext_List();;
         int start = 0; // start with
         int i = 72 ;
    //     for (int i = 71; i < sAr.length; i++) {
    while (i < sAr.length) {
    //     {     if (sAr[i] == ' ')
                   Bapitrtext Recepits7 = new Bapitrtext();
                   Recepits7.setTextid("TEXT");
                   Recepits7.setTextline(s.substring(start, i).replaceAll("[\r\n]+", ""));
                   RecepitsList7.add(Recepits7);
                   start = i+1;
                   i += 72;
         input.setText(RecepitsList7);
    The output of program is as below:
    For the first time it includes a supplementary report attempting to dete
    mine if extreme weather events can be linked to human-induced climate
    hange. The research team, including members of the UK Met Office, iden
    ified recent episodes of extreme weather then used a computer to estim
    te the likelihood of the episode happening in a world without increased
    Here as we can see last characters are getting deleted by program. For example in first line
    determine 'r' is missing in extreme right.
    In 3rd line c is missing in extreme left (word change is needed. Program
    prints hange.
    Also in 3rd line extreme right 't' is missing
    Also in 4th line extreme right 'a' is missing
    Also the last line is not being printed. In last line "CO2." " should appear.
    There are two issues:
    1. Why last word of each sentence is not being printed?
    2. Why last sentence is not being printed?
    I am struggling since last 2 days. Please help. I made all changes like replacing 72 by 71 etc.
    By making such changes, I am able to print first line correctly. However under all cases
    last character of 2nd line onward is not getting displayed.
    Also last line is not getting displayed. I did every thing like using while instead of for loop etc.
    Kindly help.
    Regards,
    Gary
    Edited by: 945655 on Jul 10, 2012 11:39 PM

    String s = wdContext.currentContextElement().getExpense_Text();
         s = s.replaceAll("[\r\n]+", " ");
         char[] sAr = s.toCharArray();
         AbstractList RecepitsList7 = new Bapitrtext.Bapitrtext_List();;
         int start = 0; // start with
         int i = 72;
    while (i < sAr.length) {
                   Bapitrtext Recepits7 = new Bapitrtext();
                   Recepits7.setTextid("TEXT");
                   System.out.println(s.substring(start, i));
                   RecepitsList7.add(Recepits7);
                   start = i+1;
                   i += 72;
         input.setText(RecepitsList7);
    Edited by: 945655 on Jul 11, 2012 2:25 AM

  • Converting a string into mySQL date format

    I have a bit of code that collects data values from a bean and I want it to then insert this into a mySQL database. My string is in the format "23/12/1983", how can i put this into a date field in my database? The bit of code I have got so far looks like this...
    String month = formHandler.month + "/";
    String day = formHandler.day + "/";
    String year = formHandler.year ;
    StringBuffer sb = new StringBuffer();
    sb.append(day);
    sb.append(month);
    sb.append(year);
    String myDate = sb.toString();myDate is the value that I want to go into the database

    Limo2kz,
    The key to inserting a date into a database is to convert the date string into an SQL friendly format. i.e. yyyy-MM-dd.
    One way of doing this is as follows:
    SimpleDateFormat NICE_DATE_FORMAT =
    new SimpleDateFormat("dd/MM/yyyy");
    SimpleDateFormat SQL_DATE_FORMAT =
    new SimpleDateFormat("yyyy-MM-dd");
    Date date = new Date();
    try {
    date = NICE_DATE_FORMAT.parse(dateString);
    } catch (ParseException pe) {
    pe.printStackTrace();
    String sqlDate = SQL_DATE_FORMAT.format(date);
    Now it is just a matter of creating the insert statement like normal, and making sure that the date string is in quotes.
    I hope that helps.
    Damian Sutton

Maybe you are looking for

  • How do I sync my iPhone with a newer Imac

    Hello, I used to sync my Iphone with an MacBook  early 09, I just bought a Brand new iMac, My phone has all the apps and music that I used to have in the old macbook, Now Im trying to Sync it with the new iMac without loosing my settings in my Iphone

  • ABAP OO & Custom made user decisions...

    Hi, I've been playing with ABAP OO for a little while now, but  keep encountering the following problem. I tried to look for the answer here, but could find it. Often I make a copy of the standard user decision task TS00008267. Then I can create my o

  • IPhoto library still 20GB in size, but only shows 500 photos in iPhoto

    HELP! My iPhoto library (which is placed on an external HDD) is about 20GB in size. Unfortunately, everytime I open iPhoto now it has forgotten about 9,500 photos. I know that they are still there due to the size of the file, but iPhoto will not read

  • Need immediate help: Idocs not showing up in productive PI

    Hi gurus, we are trying to go productive today with our pi 7.0 server. now we are facing the problem, that the idocs from our productive system don't get into the pi. in the productive erp system we can see them leaving with green status, but in sxmb

  • 7-Zip 'system cannot find the file specified' not letting me download?

    I'm about to throw my laptop to the other side of the room, run up to it and beat it with a baseball bat. I had to reset my system because I got a virus earlier[completely annoying] and I tried re-downloading Firefox through IE. First off, IE is comp