Replacing the string with a sbstring

String query="elect empname,empDate,CustNo from EmpData where (empname='smith') and ( empDate> '22/10/2005' and CustNo > '1' )";
the date here is dd/mm/yyyy formatt..
i want extract that date and change it to mm/dd/yyyy formatt and re create the same query with changed date due to some contraints in my application.not only this date i may get more dates cause its generated dynamically..
how can achieve this..
Regards,

thanks,
its not about jdbc..some times the user may enter the arabic dates.i will decide wther its arabic year are english year based upon the year digit.so if it is arabic year then i have to find the appropriate gregorian date based upon the arabic date.because in date base we store only grergorian dates..for this case iam asking for this..if found any arabic date then i will replace that date with appropriate gregorian date..i need to know how can replace this..i have the functionality for converting the arabic date to gregorian.
regards,

Similar Messages

  • Problem in replacing the String in a Fille.

    I need to replace the String in the text file, am able to do it partially.
    I mean, am able to replace it. But there are some discrepancies if the replacement string is of "less" or "more" in length than the existing one.
    I solved it for the replacement string of less size, but am unable to do it for the string of more size.. :(
    The problem am facing is "when the replacement string is larger than the existing one, then the other subsequent line in the file gets overwritten".
    I have used RandomAccessFile class for reading and writing the same file.
    fpointer1 = randomFile.getFilePointer() - strLine.length() - 2;
    strLine1 = strLine;
    int sInd = strLine1.indexOf('\'');
    int eInd = strLine1.indexOf(';');
    String oldStr = strLine1.substring(sInd + 1, eInd - 1);
    strLine1 = StringUtils.replace(strLine1, oldStr, newStr);
    if (oldStr.length() < newStr.length()) {
    int diff = (newStr.length() - oldStr.length()) + 1;
    randomFile.writeBytes("\r\n");
    for (int i = 0; i < diff; i++) {
    randomFile.writeBytes(" ");
    randomFile.seek(fpointer1);
    randomFile.writeBytes(strLine1);
    } else if (oldStr.length() > newStr.length()) {
    randomFile.seek(fpointer1);
    randomFile.writeBytes(strLine1);
    int diff = (oldStr.length() - newStr.length()) + 1;
    for (int i = 0; i < diff - 1; i++) {
    randomFile.writeBytes(" ");
    randomFile.writeBytes("\r\n");
    break;
    }Can u pls help me in resolving this issue???...

    boopathi wrote:
    As u said the overwriting causes the problem, but i managed to resolve for the string of less size.I assume you did this with some padding? That's not exactly a clean solution.
    So thats why am seeking to manage the larger size string to replace without overwriting the sub sequent lines.
    Can you help me in suggesting whether it can be resolved using the getFilePointer() and seek() methods??...No you can't.
    Whether you shorten or lengthen the position where you modify the file, you need to move the remaining bytes back or forward, depending which is the case.
    You managed to solve the first case by printing out padding, so you don't need to move the bytes back, but you can't solve the other case like this. You can lengthen the file and move the remaining bytes forward, but I probably wouldn't bother since a simple Reader-based approach is a lot better and easier to get right.

  • Replace a string with another string in a file

    I have to replace a string with another string. Say for example in a html file it got a line like,
    <a href="##"></a>
    now i want to replace this ## with the full derived path like
    "c;\\sample folder\\sample subfolder\\samplefile.html"
    can someone help me to do this?
    pls tell me from the file opening till closing the file.

    I have to replace a string with another string. Say
    for example in a html file it got a line like,
    <a href="##"></a>
    now i want to replace this ## with the full derived
    path like
    "c;\\sample folder\\samplesubfolder\\samplefile.html"
    can someone help me to do this?
    pls tell me from the file opening till closing the
    file.
    public class Buckel {
      final static String CONST = "c:\\sample folder\\samplesubfolder\\samplefile.html";
      public Buckel() {
      public static void main ( String[] argv )  throws Exception {
        int    idx = 0;
        String in  = "<a href=\"##\"></a>",   // We'll imagine this just gets here somehow. If it's on the i/p file then take the '\' out B4 and aft the '##'.
               out = "";
        idx = in.indexOf( "##" );
        if ( idx > 0 ) {
          out = in.substring( 0, idx ) + CONST + in.substring( idx+=2, in.length() );
        System.out.println( out );
    }

  • Since i got the new Iphone 4s it constantly drops calls. Apple have replaced the phone with another new iphone 4s but i am still having the same problem. I have checked with vodapohe that there is no issue from there end, given a new sim, still drops out

    Since i got the new Iphone 4s it constantly drops calls. Apple have replaced the phone with another new iphone 4s but i am still having the same problem. I have checked with vodapohe that there is no issue from there end, given a new sim, still drops out

    Have a look at this it might help
    http://support.apple.com/kb/TS4148

  • I have a Mac book pro with regular drive, I want to replace the drive with SSD, so can I do t for Mac book pro purchased in 2012 and which SSD is recommended. I am looking for 500 to 700GB SSD.

    I have a Mac book pro(13 inch non-retina, i7) with regular drive, I want to replace the drive with SSD, so can I do it for Mac book pro purchased in 2012 and which SSD is recommended.
    I am looking for 500 to 700GB SSD.
    Thanks

    Upgrading your MacBook Pro with a Solid State Drive...
    ...call back with any questions.
    Clinton

  • Replacing the bapi with the new bapi for purchase order creation

    Hi,
       In the customised code call is there for the bapi function module  'BAPII_PO_CREATE'.
       Iam trying to replace the call with the code that calls function module 'BAPI_PO_CREATE1'.
       Please help me about what changes I needed to do in the code . As there is much mismatch in the import and export parameters
    and tables in both the function modules.
       Thanks in advance.
    Edited by: anwar.indya on Mar 25, 2011 2:18 PM
    Edited by: anwar.indya on Mar 25, 2011 2:19 PM

    Hi,
    As per  u r requirement
    you can use  : BAPI =>    BAPI_PO_CREATE  with suitable Document  Type ( Stock trasnfert : STO )
    IF  u want to auto po must be created after each delivry in this case you need to use BADI
    'MB_MIGO_BADI; In This BAPI  There is method : POST_DOCUMENT
    In this method u can write code for Auto PO Creation by using BAPI .
    Hope This will Resolve u r query.
    Thanks and Regads
    Santosh

  • How to replace the '&' character with '&' in xi

    Hi,
    i need to replace the '&' character with ' &amp;'.but i f i am converting it is displaying as '&' because internally '&amp;' = '&'.
    beacuse of this it is not converting.
    is there any possiblity to change the  standard conversion in xi.

    Graphical mapping does not support special character like & , <,> to be mapped.
    You can encode & as and in UTF-8 only.
    if you want the special character to be used, Opt XSLT mapping with ISO-8859-1 encoding
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" encoding="ISO-8859-1"/>
    <xsl:template match="/">
    <xsl:copy-of select="*" />
    </xsl:template>
    </xsl:stylesheet>
    How to Work with Character Encodings in Process Integration (NW7.0)
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42

  • How do I replace the organiser with a new one

    How do I replace the organiser with a new one

    The problem is to understand your question (or your two questions : do you both mean the same thing ?)
    An answer to Hatstead question would help.
    1 - Do you really mean using another software to organize your workflow ?
    2 - Do you mean using other softwares based on folders rather than databases ?
    3 - Or do you mean working with different catalogs ?
    If you don't want to use the Organizer, it's not possible to 'delete' it, but it is simple not to use it.
    Most other organizing solutions include the choice of selecting PSE editor as the external editor
    There are various solutions depending on your platform : Windows, Mac, Linux...
    It's important to know if you prefer the folders or database organization to suggest possible solutions.

  • Can I replace the LCD with an LED on Early 2009 24" model?

    I have an old 2009 (okay, so not that old) iMac and the LCD has some serious burn-in and it's to the point where I can't use the computer without it hurting my eyes. I'm looking to replace the screen, but the computer still works great and I don't want to have to do this again in four to five years. Any chance I can take an LED display from a 24" Cinema Display and put it in the iMac, or are the connections different?

    Personally I would use a Mini DisplayPort to DVI Adapter, DVI cable and a $130 DVI monitor, before shelling out for a $500 to $600 for a replacement panel. Or at least until your 100% sure, that there is nothing wrong with the logicboard or graphic's chip.
    Optionally a Belkin Mini DisplayPort to HDMI Cable would be an even cheaper setup, if you already have an HDMI TV.
    Addtitionally I would probably just replace the iMac with another iMac or Mac Mini, because it is real hard to justify spending anything at all on a 5 year old system.

  • How can I remove a person's face from a photo and then replace the spot with a person's face from another photo?

    How can I remove a person's face from a photo and then replace the spot with a person's face from another photo?

    In Editor, go to the expert tab.
    Open picture B, the one you wish to select the "replacement" face from to add to another picture.
    Use one of the selection tools, e.g. selection brush, lasso tool, to select the face. You will see an outline ("marching ants") once the selection is complete
    Go to Edit menu>copy to copy the selection to the clipboard
    Open picture A, then go to Edit>paste
    Use the move tool to position the face from picture B to cover the face on A
    In the layers palette you should see picture A as the background layer, and face B on a separate layer

  • Replace the wait with java embedding thread.sleep() function

    Hi,
    How to replace the wait with java embedding thread.sleep() function. Can anyone help.
    Thanks.

    drag and drop the java embedding component
    include the following code in it.
    try{ 
    Thread.sleep(60000);
    }catch(Exception e)
    --Prasanna                                                                                                                                                                                                                                                                                                                           

  • Owa_text.vc_arr: can't handle the string with more than 4000 characters?

    In the Oracel Web Application Server 4.0 documment, it says
    about owa_text.vc_arr :Type vc_arr is table of varchar2(32767)
    index by binary_integer.
    I amusing PL_SQL with Oracle8i and OWA4.0 web server.I want to
    use owa_text.vc_arr to pass the multple line texts in my form.
    If the text length is less than 4000 characters, everything works
    fine.However when the texts are longer than 4000 characters but
    less than the max length 32767 characters, I got this error
    message:
    OWS-05101: Execution failed due to Oracle error 2005
    ORA-02005: implicit (-1) length not valid for this bind or define
    datatype.
    Owa_text.vc_arr is supposed to handle the string with more
    than 4000 characters, is it true? Could anyone tell me why? Any
    help will be greatly appreciated!!!
    Thanks very much.
    Helena Wang
    Here is the pl_sql procedure to create my form:
    PROCEDURE myform
    IS
    BEGIN
    htp.p('
    <form action="'||service_path||'helena_test.saveform3"
    method=post>
    <input type=hidden name=tdescription value="X">
    Input1: <textarea name=tdescription rows=50 cols=70
    WRAP=physical></textarea>
    Input2: <textarea name=tdescription rows=50 cols=70
    WRAP=physical></textarea>
    <input type=submit name=WSave value="Save">
    </form>
    END;
    /***** here is the pl_sql procedure which I use to save the
    form***/
    procedure saveform3(tdescription in owa_text.vc_arr,
    WSave in varchar2 default 'No')
    is
    len pls_integer;
    begin
    for i in 2..tdescription.count loop
    len := length(tdescription(i));
    htp.p(len);
    htp.p(tdescription(i));
    end loop;
    end;

    Helena, I think you might get a better response either from the SQL-PL/SQL forum, or perhaps the Portal Applications forum - both of these tend to have folks very familiar with PL/SQL and the OWA packages.
    This forum is on Web services based on SOAP, WSDL and UDDI. These can be PL/SQL based but typically don't use the mod_psql or OWA web solution.
    As a pointer, I suspect you may already be familiar with, but just in case, you can always take a look at chapter 3 of the OAS documentation, "Developer's Guide: PL/SQL and ODBC Applications" where they go through a number of examples using parameters. See:
    http://technet.oracle.com/doc/appsrvr4082/guides/plsql.pdf
    Hope this or folks from the other list can help.
    Mike.

  • Why can't  owa_text.vc_arr  handle the string with more than 4000 characters?

    I am using PL_SQL with Oracle8i and OAS 4.0 web server.I want to
    use owa_text.vc_arr to pass the inputs in serval text areas in the form on a web application.
    If the input string length is less than 4000 characters, everything works fine.However when the strings are longer than 4000 characters but less than the max length 32767 characters, I got this error message:
    OWS-05101: Execution failed due to Oracle error 2005
    ORA-02005: implicit (-1) length not valid for this bind or define datatype.
    In the Oracle Application Server 4.0 documment, it says
    about owa_text.vc_arr :Type vc_arr is table of varchar2(32767)
    index by binary_integer. It means that owa_text.vc_arr can handle multiple strings and each string can have up to 32767 single byte characters, is it right?
    Owa_text.vc_arr is supposed to handle the string with more
    than 4000 characters, is it true? Could anyone tell me why? Any
    help will be greatly appreciated!!!
    Thanks very much.
    Helena Wang
    Here is the pl_sql procedure to create my form on the web:
    PROCEDURE myform
    IS
    BEGIN
    htp.p('
    <form action="'||service_path||'helena_test.saveform3"
    method=post>
    <input type=hidden name=tdescription value="X">
    Input1: <textarea name=tdescription rows=50 cols=70
    WRAP=physical></textarea>
    Input2: <textarea name=tdescription rows=50 cols=70
    WRAP=physical></textarea>
    <input type=submit name=WSave value="Save">
    </form>
    END;
    /***** here is the pl_sql procedure which I use to save the
    form***/
    procedure saveform3(tdescription in owa_text.vc_arr,
    WSave in varchar2 default 'No')
    is
    len pls_integer;
    begin
    for i in 2..tdescription.count loop
    len := length(tdescription(i));
    htp.p(len);
    htp.p(tdescription(i));
    end loop;
    end;

    The maximum size of a VARCHAR2 field in Oracle 8i is 4000 bytes.
    you'll ned to use a LOB type (or LONG if you prefer the old way)

  • How can I replace the Portal with completely new Flash website?

    Can I replace the Portal with completely new Flash website? My customer do not want the JSP UI. Instead, he wants a completely new designed Flash site. Is it possible to do it? How can I deploy a new portal to cover the current one?

    If you have a look at some of the code examples which do the equivalent of site maps, you could in theory replace the whole portal desktop with some sort of Flash framework which reads the user's role structure at run time.
    I think it is useful to remember that the SAP portal is primarily a business application launchpad. It does that very well. Trying to make it into a Flash launchpad will be challenging.

  • My iphone has fallen into the water 6months ago and there is no apple store in my country so i gave the phone s technical service.but they couldnt repair the phone.and now the battery is swollen.can i replace the phone with the new one in spain?

    My iphone has fallen into the water 6months ago and there is no apple store in my country so i gave the phone s technical service.but they couldnt repair the phone.and now the battery is swollen.can i replace the phone with the new one in spain?

    You can only obtain warranty OR post warranty service in the country of original purchase
    As your iPhone has user damage it has no warranty
    IF the iPhone originated from Spain or another EU country you can get out of warranty service in any EU country

Maybe you are looking for

  • Sales tax in PO but not included at the time of GR

    Hi, i have creted the PO including sales tax amount, is there any way when i post the GR against this PO the sales tax amount not calculated.

  • Setting elements in master pages to display in the foreground

    Hi, I am following "Building your first website with Muse, part 3", in order to learn how the header content displays in the foreground, above the page content as the pages scroll. I've been following all the steps (with the Katie's Café website), bu

  • "Alert:  Couldn't contact spell checker" in text fields

    Whenever I put my cursor in a text field of any type (login, password, search, filling a form) in Safari, I get a spinning rainbow wheel and then a message that says Alert: Couldn't contact Spell Checker. If I click Okay, I have about two characters

  • Is there a way to sort files Alphabetically?

    I have a few files on my numbers screen and I think it be easier to find what I am looking for if it was alphabetically. I know the search option is there and I can use that but sometimes a guy just needs options.

  • Blank Screen for K8N Neo2, HELP!!!

    Ok, my computer used to be working, with windows XP Pro installed, but now it just won't boot up the monitor.  The last time I reinstalled the computer, it still wouldn't boot the screen, or would freeze at the platinum screen.  I don't think it is t