HR-Unicodes for APPEND Statement

Hi all,
Am new to HR-Unicodes
Could any body tel me How to use Append Statement in Unicode compatible format.
like for ex am appending structure to Table as follows:
APPEND p_innnn TO p_del_tab.
Am getting follwing error:
A line of "P_DEL_TAB" and "P_INNNN" are not mutually convertible. In a Unicode
program "P_DEL_TAB" must have the same structure layout as "P_INNNN"
independent of the length of a Unicode character.
could u please tel me the solution for this.?/
How should i use APPEND here.
Points will be rewarded.
Thanks in Advance.
Regards,
Kalam A.

Try looking at the methods in class CL_HR_PNNNN_TYPE_CAST.  This class provides various methods for moving internal table, structures etc that have a standard infotype structure to the generic innnn table and structure.
If you do a where used on the class, you will find many examples of how to use this.
Best Regards,
Chris H.

Similar Messages

  • HR-Unicodes for WRITE Statement

    Hi All,
    Am getting the problem with the WRITE Statement in Unicodes.
    i have declared the table like:
    FORM list_result
    TABLES p_pcl1_tab STRUCTURE pcl1.
    & i have writtten the write statement as follows:
    LOOP AT p_pcl1_tab.
    WRITE: / sy-tabix, p_pcl1_tab.
    ENDLOOP.
    Am getting the follwing Error:
    "P_PCL1_TAB" cannot be converted to a character-type field.
    So could any body can tel me the solution for this.
    Points will be rewarded,
    Thax in Advance.

    Hello
    Try this
    LOOP AT p_pcl1_tab.
    WRITE: / sy-tabix, p_pcl1_tab-RELID, p_pcl1_tab-SRTFD.
    ENDLOOP.
    ****i.e you will need to write fields individually.
    Reward points if helpful

  • OPEN DATASET......FOR APPENDING

    Hello ppl,
    I found the following help for OPEN DATASET in APPENDING mode:
    If the file already exists, its contents are retained, and the system moves to the end of the file. If the file does not exist, the system creates it. If the file was already open, the system moves to the end of the file.
    But, I am not sure what exactly will happen if the file is already open.
    Please help me understand it better.
    Thanks,
    Dawood.

    Hello,
    From SAP HELP.
    Attempted read access to a file opened with FOR APPENDING with the statement READ DATASET fails, and returns the value 4 for sy-subrc.
    It will not let you write to a already opened file.
    Hope it helps.
    Thanks,
    Jayant

  • Nologging for insert statement

    Hello,
    Is it possible to use NOLOGGING with INSERT statement?
    For example:
    INSERT /*+ APPEND PARALLEL(test,4)*/INTO test NOLOGGING (select .....)
    It will take NOLOGGING as alias name of table or what is correct way to use NOLOGGING for insert statement.

    There is no such thing as a NOLOGGING hint (or insert keyword as you've tried it).
    You must use ALTER TABLE table_name NOLOGGING;

  • Generate unicode for a string

    Hi frnz
    I have a string of a language, how can I generate unicode for the same
    thnks
    alpesh

    again confusion...
    my problem is I dont have \u1234 I have
    character of a hindi language and I want to
    generate unicode like \u1234
    alpeshIf this is not what you want then I'm really confused!
            String aString = "The \u1234quick brown fox jumps over the lazy dog.";
            StringBuilder sb = new StringBuilder();
            Formatter formatter = new Formatter(sb, Locale.UK);    
            for (int i = 0; i < aString.length(); i++)
                char ch = aString.charAt(i);
                sb.append("\\u");
                formatter.format("%04x", (int)ch);
            System.out.println(sb);

  • Unicodes for portal

    hello experts,
    we have a requirement of converting contents displayed into 2 languages.
    we need to display the contents in english and marathi.
    can anybody suggest a link where i can get unicodes for portal which we can paste into our properties files for display in marathi??
    waiting and thanks in advance
    -jagdish

    Jagdish,
    we had a similar requirement previously.
    you can get these conversion done at :
    http://people.w3.org/rishida/scripts/uniview/conversion
    but an additioal activity of appending \u to codes is needed to be done for every 4 digit code generated.
    regards
    Kedar
    reward points if useful

  • HT1212 MY PHONE IS LOCKED MY STEPSON SET UP A ICLOUD ACCOUNT AN NOW HE DOES NOT KNOW THE USERNAME OR PASSWORD AN I HAVE TRIED HOOKING IT UP TO ITUNES AN CAN NOT RESET ANYTHING. WHEN U TURN THE PHONE ON IT SAYS HELLO AN THEN ASK FOR THE STATE AN THE WIRELE

    HEY MY PHONE IS LOCKED AND MY STEPSON STEP UP A ICLOUD ACCOUNT AN KNOW HE DOES NOT KNOW THE ICLOUD USERNAME OR PASSWORD. WHEN I TURN THE PHONE ON IT WILL SAY HELLO AN ASK FOR THE STATE AN THE ASK FOR THE INTERNET PASSWORD. THEN IT ASK FOR THE ICLOUD AN THE PASSWORD AN WE DONT KNOW IT TO GET THE PHONE UNLOCKED. I HAVE TRIED HOOKING IT UP TO ITUNES BUT IT DOES NOTHING JUST GOES BACK TO THE SAME SCREEN. SO CAN U PLEASE HELP ME UNLOCK MY PHONE. IVE BEEN THE THE VERIZON STORE AN THE THE APPLE STORE AN THE SAID THEY CANT UNLOCK IT THAT I HAD TO GO ON AN WEBSITE IFORGOT.APPLE.COM AND EXPRESSLANE.APPLE.COM AN WHEN U PULL IT UP YOU DONT KNOW WHAT TO GO ON BECAUSE THERE IS SOME MANY TO CHOOSE FROM SO IT DOESNT HELP ME AT ALL. ITS LIKE THAT ON BOTH WEBSITES THEY FAIL TO TELL U THAT THERE IS ALOT TO CHOOSE FROM. IF THEY WOULD GIVE YOU THE ONE TO GO TO START WITH U WOULDNT BEEN ON THE COMPUTER FOR HOURS AN HOURS AT A TIME.

    drop the CAPS thats rude.
    iforgot.apple.com there is a link for find my apple id click here
    https://iforgot.apple.com/appleid?language=US-EN&returnURL=https://appleid.apple .com/cgi-bin/WebObjects/MyAppleId.woa&app_id=93&app_type=ext
    Peace, Clyde

  • ID 5.5 Interact. PDF, cannot remove white background for Multi-States and buttons.

    Hi
    I am working on an Interactive PDF Portfolio document. The problem I have is with Multi-State object feature with several buttons going to states that need to be exported as a SWF and imported back into InDesign 5.5. See, the background of my entire doc. is GREY, but when I import the SWF (as directed in Lynda.com videos correctly) and export the entire doc as Interactive PDF and view it in Adobe Acrobat Pro (version 10.1.1) is when all the trouble starts.
    When I try to get rid of the WHITE background around the Multi-State objects and the buttons for them (using Select Object Tool and then control+click on it to change the Properties to Transparent Background Appearance) it does not change, even when I go forward and backward to the page.
    Does the option of removing white background and making it transparent work only for Animation, but not Multi-State feature with buttons?
    Can anyone suggest any other tecnique to create a nice slide show that works in Interactive PDF in ID CS5.5? Please..
    Sincerely,
    in need of help,
    Eve

    I have 8 Multi-State objects in one stack on the left and the 8 buttons for each state in the stack on the right. The background of my document is dark grey. There is space inbetween Multi-State objects and the buttons that show the grey background. But after exporting as SWF the Multi-States together with the buttons and placing the SWF back in the PDF file, the space inbetween Multi-States and buttons that is supposed to show the grey background appears white. The problem is that I cannot even change this white background to transparent in Acrobat Pro, as well. I used to do that to animations and it worked, but not in this case.

  • Enum class not supported for switch() statement in 12.4 beta?

    Hi fellow 12.4 beta testers,
    It would appear "enum class" isn't supported for switch() statements in the 12.4 beta. This compiles fine under clang and g++. Will this be fixed for the final release? This currently causes compile errors for us, since __cplusplus >= 201103L evaluates to true, so our code uses "enum class" instead of plain "enum". It looks like the C++11 standard says it should be supported:
       Switching on enum class in C++ 0x - Stack Overflow
    Many thanks,
    Jonathan.
    $ cat test.cpp
    #include <iostream>
    enum class Ternary { KnownFalse = 0, KnownTrue = 1, Unknown = 2 };
    int main( void )
       Ternary foo;
       switch ( foo ) {
          case Ternary::KnownTrue:
          case Ternary::KnownFalse:
          case Ternary::Unknown:
             std::cout << "Success\n";
    $ clang++ -std=c++11 test.cpp
    $ g++ -std=c++11 test.cpp
    $ /opt/SolarisStudio12.4-beta_mar14-solaris-x86/bin/CC -std=c++11 test.cpp
    "test.cpp", line 8: Error: Cannot use Ternary to initialize integral type.
    "test.cpp", line 8: Error: Switch selection expression must be of an integral type.
    "test.cpp", line 9: Error: An integer constant expression is required for a case label.
    "test.cpp", line 10: Error: An integer constant expression is required for a case label.
    "test.cpp", line 11: Error: An integer constant expression is required for a case label.
    5 Error(s) detected.

    Thanks for reporting this problem! I have filed bug 18499900.
    BTW, according to the C++11 standard, the code is actually not valid. Section 6.4.2, switch statement, says an implicit conversion to an integral type is required, which is not the case for for a scoped enum (one using the "class enum" syntax). This limitation was raised in the C++ Committee as an issue to be fixed, and the C++14 standard makes the code valid.
    As a workaround, or to make the code conform to C++11, you can add casts to int for the enum variable and the enumerators.
    Message was edited by: Steve_Clamage

  • GROUP BY - Is there a way to have some sort of for-each statement?

    Hi there,
    This discussion is a branch from https://forums.oracle.com/thread/2614679
    I data mart I created for a chain of theatres. The fact table contain information about ticket sales, and I have a some dimensions including DimClient and DimTime.
    Here is an example of each table:
    FactTicketPurchase
    TICKETPURCHASEID
    CLIENTID
    PRODUCTIONID
    THEATREID
    TIMEID
    TROWID
    SUMTOTALAMOUNT
    60006
    2527
    66
    21
    942
    40
    7
    60007
    2527
    72
    21
    988
    36
    6
    60008
    2527
    74
    21
    1001
    40
    6
    60009
    2527
    76
    21
    1015
    37
    6
    60010
    2527
    79
    21
    1037
    39
    6
    DDL for FactTicketPurchase
    CREATE TABLE FactTicketPurchase(
    TicketPurchaseID NUMBER(10) PRIMARY KEY,
    ClientID NUMBER(5) CONSTRAINT fk_client REFERENCES DimClient,
    -- ProductionID NUMBER(5) CONSTRAINT fk_prod REFERENCES DimProduction,
    -- TheatreID NUMBER(5) CONSTRAINT fk_theatre REFERENCES DimTheatre,
    TimeID NUMBER(6) CONSTRAINT fk_time REFERENCES DimTime,
    -- TRowID NUMBER(5) CONSTRAINT fk_trow REFERENCES DimTRow,
    SumTotalAmount NUMBER(22) NOT NULL);
    DimClient
    CLIENTID
    CLIENT#
    NAME
    TOWN
    COUNTY
    2503
    1
    LEE M1
    West Bridgford
    Nottingham
    2504
    2
    HELEN W2
    Hyson Green
    Nottingham
    2505
    3
    LEE M3
    Lenton Abbey
    Nottingham
    2506
    4
    LORA W4
    Beeston
    Nottingham
    2507
    5
    SCOTT M5
    Radford
    Nottingham
    2508
    6
    MINA W6
    Hyson Green
    Nottingham
        ..cff.
    DDL for DimClient
    CREATE TABLE DimClient(
    ClientID NUMBER(5) PRIMARY KEY,
    Name VARCHAR2(30) NOT NULL);
    DimTime
    TIMEID
    FULLDATE
    YEAR
    SEASON
    MONTH
    MONTHDAY
    WEEK
    WEEKDAY
    817
    02-MAR-10
    2010
    Spring
    3
    2
    9
    3
    818
    03-MAR-10
    2010
    Spring
    3
    3
    9
    4
    819
    04-MAR-10
    2010
    Spring
    3
    4
    9
    5
    820
    05-MAR-10
    2010
    Spring
    3
    5
    9
    6
    821
    06-MAR-10
    2010
    Spring
    3
    6
    9
    7
    822
    07-MAR-10
    2010
    Spring
    3
    7
    9
    1
    DDL for DimTime
    CREATE TABLE DimTime(
    TimeID NUMBER(6) PRIMARY KEY,
    Year NUMBER(4) NOT NULL,
    Season VARCHAR2(20));
    I have the following analysis request to perform on this data mart:
    Top 5 clients by value of ticket sale for each season
    For this requirement I came up with the following query:
    SELECT * FROM
    (SELECT FacTIC.ClientID, DimCLI.Name, SUM(SumtotalAmount) SumTotalAmount, DimTIM.Season
    FROM FactTicketPurchase FacTIC, DimClient DimCLI, DimTime DimTIM
    WHERE FacTIC.ClientID = DimCLI.ClientID
    AND FacTIC.TimeID = DimTIM.TimeID
    AND Season = 'Spring'  AND Year = 2010
    GROUP BY Season, FacTIC.ClientID, DimCLI.Name
    ORDER BY Season ASC, SumTotalAmount DESC)
    WHERE rownum <=5;
    As you can see, in line 06 of the above query, I am explicitly specifying the season for the query to return.
    However what I would like to do is just one query that could autocratically go through the seasons and years available in the time dimension in a fashion similar to a FOR-EACH statement. This way, if we get more years added to the time dimension, we wouldn't have to amend the query.
    Is this possible?
    Regards,
    P.

    I think I fixed it!
    The trick was to look into the r_num value. As soon as I added it to my query I started to see how r_num was being calculated and I realised that I had to add Season to my partition, right after Year.
    SELECT Year, Season, TotalAmount, Name
    FROM (
       SELECT   DimCLI.Name
       ,        DimTIM.Year
       ,        DIMTIM.Season
       ,        SUM(FacTIC.SumTotalAmount) TotalAmount
       ,        RANK() OVER (PARTITION BY Year, Season
                             ORDER BY SUM(FacTIC.SumTotalAmount) DESC
                            ) AS r_num
       FROM     FactTicketPurchase FacTIC
       ,        DimClient DimCLI
      ,         DimTime DimTIM
       WHERE    FacTIC.ClientID = DimCLI.ClientID
       AND      FacTIC.TimeID = DimTIM.TimeID
       GROUP BY DimTIM.Year
       ,        DimTIM.Season
       ,        DimCLI.Name
    WHERE r_num <= 5 -- Need to amend this line on my data sample to show 2 rows.
    ORDER BY Year, Season, TotalAmount DESC;
    Looking at my data sample, I got the following:
    YEAR
    SEASON
    TOTALAMOUNT
    CLIENTID
    2010
    Autumn
    29
    2504
    2010
    Autumn
    26
    2503
    2010
    Spring
    25
    2503
    2010
    Spring
    14
    2506
    2010
    Summer
    26
    2506
    2010
    Summer
    26
    2504
    2010
    Winter
    28
    2503
    2010
    Winter
    26
    2506
    2011
    Autumn
    23
    2506
    2011
    Autumn
    14
    2503
    2011
    Spring
    25
    2505
    2011
    Spring
    13
    2503
    2011
    Summer
    21
    2505
    2011
    Summer
    14
    2503
    2011
    Winter
    19
    2505
    Now, looking at my real data, (considering the top 5 rows, not the top 2), I got:
    YEAR
    SEASON
    TOTALAMOUNT
    NAME
    2010
    Autumn
    141
    BUSH M225
    2010
    Autumn
    140
    DIANA W66
    2010
    Autumn
    136
    HANA W232
    2010
    Autumn
    120
    DIANA W220
    2010
    Autumn
    120
    WILSON M459
    2010
    Spring
    137
    DAVID M469
    2010
    Spring
    125
    ALEX M125
    2010
    Spring
    124
    PETER M269
    2010
    Spring
    115
    ZHOU M463
    2010
    Spring
    114
    TANIA W304
    2010
    Summer
    138
    JANE W404
    2010
    Summer
    105
    MINA W8
    2010
    Summer
    97
    DAVID M275
    2010
    Summer
    96
    CLINTON M483
    2010
    Summer
    93
    ANNA W288
    2011
    Spring
    12
    LUISE W20
    2011
    Spring
    7
    ANNA W432
    2011
    Spring
    7
    LEE M409
    2011
    Spring
    7
    CHRIS W274
    2011
    Spring
    7
    HELEN W136
    2011
    Spring
    7
    LILY W114
    2011
    Spring
    7
    LUISE W348
    2011
    Spring
    7
    LIU M107
    2011
    Spring
    7
    VICTORY W194
    2011
    Spring
    7
    DIANA W240
    2011
    Spring
    7
    HELEN W120
    2011
    Spring
    7
    LILY W296
    2011
    Spring
    7
    MATTHEW M389
    2011
    Spring
    7
    PACO M343
    2011
    Spring
    7
    YANG M411
    2011
    Spring
    7
    ERIC M101
    2011
    Spring
    7
    ALEX M181
    2011
    Spring
    7
    SMITH M289
    2011
    Spring
    7
    DIANA W360
    2011
    Spring
    7
    MATTHEW M63
    2011
    Spring
    7
    SALLY W170
    2011
    Spring
    7
    JENNY W258
    2011
    Spring
    7

  • Problem For/Each statement (or the problem is the MouseListener...)

    Hi guys,
    I'm making a program in java for school.
    Now I have this:
              for(Stap2TrampolineModel trampoline : lijstTrampolines)
                   trampoline = new Stap2TrampolineModel(0,215,100,"Poing",lijstKinderen); //model
                   trampolineView = new Stap2TrampolineView(trampoline); //view
                   trampolineController = new Stap2TrampolineController(trampoline, trampolineView); //controller
                   trampolineView.setBounds(trampoline.getXInvoer(),trampoline.getYInvoer(),trampoline.getFormaat()+1,20);
                   add(trampolineView);
                   repaint();
    and in the mouselistener this:
    public void mouseClicked( MouseEvent e )
              System.out.println(lijstTrampolines.size());
              // Onderzoek of met de rechterknop is geklikt
    if( e.isMetaDown() )
         // x = e.getX(); (for later needs)
    //y = e.getY(); (for later needs)
    lijstTrampolines.add(trampoline);
    repaint();
    The program should display a "trampoline" when I click...but it doesnt. It is added to the list, because I can see that in the console because of the System.out.println
    But it doesn't show the display I want. When I delete the for each statement, it does show the "trampoline". So the mouselistener works (it gets added when I click) and the arraylist works (it shows that in the console), but the for each statement doesnt work...
    Anyone knows how to solve this problem?

    Where is this foreach loop located? In inialisation presumably. But that's over and done with when your mouseListener is called. I'd guess your list is empty when the loop is called, and it does nothing.
    Your mouse listener, when it adds a trampoline must also add a trampoline view object. And the repaints don't do you any good, use revalidate() after adding a trampoline view to recalculate the layout.

  • Date formats for SQL statements used by recordset object

    Hi,
    Date formatting appears to be quite problematic for Business One.  I did a forum search for date issues and I don't think I saw any of them with an "answered" status.  I have an issue with formatting a date for the creation of an SQL statement that the DI sends to SQL Server 2005.  I need to format a date so that the localization parameters don't matter for either the client machine or SQL Server's machine.  We don't have a problem as long as our machines are localized as USA.
    I have PL 22 and I have a form - ours - where I use the Today() function to fill a date field.  So this is a date that is not entered by the user.  The result of this function is consistent with the localization parameters on my machine.  We have two other date fields on the form where the user must type in the date. 
    As a test, I changed my machine to the UK parameters.  I then set up the language parameters of Business One for English(United Kingdom).  I changed the date format specifications in Business One so that its format is dd/mm/yy.  I then brought up the form and the field that is formatted by the above function arrived in the form's field as dd/mm/yy.  I then typed in the two other dates in the same format and added the record to the database.  The form's table is user-defined. 
    I dismissed the form then brought it back up loaded with the new record.  The date that was entered by the function appeared in USA format (mm/dd/yy).  The dates that were typed in appeared in the Business One format (dd/mm/yy).  This of course is not consistent.
    When I looked at what got into the database, the formats were the opposite.  Weird!  To make matters really confusing, I run an SQL statement within SQL Server Mgt Studio, and use the WHERE clause to filter on the date that was based on the function.  It didn’t matter what format I used for the WHERE clause, the record came up.  Does anyone have any idea about how I can ensure that I always use the correct date format for SQL statements passed by Business One to SQL Server regardless of where in the world the application is being run?
    Thanks,
    Mike

    Ian,
    Here's what I'm concerned about:  I’m using the date in a “WHERE” clause.
    Assume the date is Aug 3, 2007.
    "SELECT * FROM Table WHERE StartDate > ‘8/3/2007’"
    OR
    "SELECT * FROM Table WHERE StartDate > ‘3/8/2007’"
    If the client machine is set up as USA, the today function will provide the date as formatted in the first query.  If the database server is setup as let’s say the UK, I believe that SQL Server query parser will interpret the date as Mar 8, 2007.
    If the client machine is set up as UK, the today function will provide the date as formatted in the second query.  If the database server is setup as let’s say USA, I believe that SQL Server query parser will also interpret the date as Mar 8, 2007.
    In both cases it would be wrong.
    I know I could use the DATEPART function to get the three parts and this will make the code indifferent to the localization specs of the client machine.  I need to then be able to concatenate those date parts for the “WHERE” clause so that the localization specifications of the database server don’t matter.
    Thanks,
    Mike

  • Variable Use in For-Each statement

    Hello Gurus-
    I am having an issue using a variable i've created in a for each statement. Here is the code i'm using
    My objective is to create a variable based on the kind of invoice. If the invoice is a proof or reprint, one copy should be printed. If it's a final invoice, I need two copies.
    <?xdoxslt:set_variable($_XDOCTX, 'x', 0)?>
    for-each<?if: Print_Additional_Header_Text_ID238='PROOF'?><?xdoxslt:set_variable($_XDOCTX, 'x', 1)?><?end if?>
    <?if: Print_Additional_Header_Text_ID238='REPRINT'?><?xdoxslt:set_variable($_XDOCTX, 'x', 1)?><?end if?>
    <?if:not ( Print_Additional_Header_Text_ID238)?><?xdoxslt:set_variable($_XDOCTX, 'x',2)?><?end if?>
    <?xdoxslt:get_variable($_XDOCTX,'x')?><?for-each@section:xdoxslt:foreach_number($_XDOCTX,1,$x,1)?>
    for-each is the loop i'm using to repeat sections of the invoice.
    When I run the preview with the last for-each print, i get an error that says "variable not defined:'x' "
    But when i remove the last for each the correct variable, 1 or 2, will show in the invoice.
    My question is: How can I use the variable 'x' in <?for-each@section:xdoxslt:foreach_number($_XDOCTX,1,$x,1)?>
    TIA
    Darius
    Edited by: 852460 on May 24, 2011 8:31 AM
    Edited by: DEK17 on Jul 20, 2011 1:15 PM

    Probably, this will help
    http://winrichman.blogspot.com/search/label/multiple%20copy
    Try
    <?for-each@section:xdoxslt:foreach_number($_XDOCTX,1,get_variable($_XDOCTX, 'x'),1)?>
    or
    <?for-each@section:xdoxslt:foreach_number($_XDOCTX,1,xdoxslt:get_variable($_XDOCTX, 'x'),1)?>

  • Segfault in OCIHandleFree for a statement after closing the connection

    my app has lots of statements allocated at any one time.
    if the oracle connection is lost (due to temporary network problems, etc), my app detects the connection loss. when the connection is lost, the app destroys the old connection, and then tries to create a new connection. once it gets a new connection, the app goes through and destroys its old statements.
    but, sometimes a segfault occurs in the call to OCIHandleFree.
    when the old connection is destroyed, does it also free up all memory allocated for the statement too? so I'm basically doing a double free when I try to call OCIHandleFree on the statements?
    btw, by 'destroy old connection': the app is using the oralib wrapper around the oci library. when an oralib instance is destroyed, it first switches the server handle to OCI_ATTR_NONBLOCKING_MODE, then calls OCISessionEnd, OCIServerDetach, then OCIHandleFree for each of the svc_context, session, error, and server handles.
    after that, a new oralib instance is created, which makes a new connection to oracle.
    then after that, the old statements will all be passed to OCIHandleFree.
    is there any obvious problem with that? thanks!

    It is very important to close them as you might have a resource leak. Many people think that since Java is garbage collected, they don't have to worry about memory. While this is true, it should not be take to the extreme.
    public void method throws SQLException
         Connection conn = DriverManager.getConnection();
         Statement stmnt  = conn.createStatement();
         ResultSet results = stmnt.executeQuery("SELECT * FROM table;");
         results.close();
         stmnt.close();
         conn.close();
    }The above code looks correct, but in fact it is not completely correct. It is not completely correct, because the release of resources is not ensured. If an exception occurs midway, it's possible that the resources will not be properly released.
    Here is the correct code.
    public void method throws SQLException
         Connection conn = null;
         Statement stmnt = null;
         ResultSet results = null;
         try
              conn = DriverManager.getConnection();
              stmnt = conn.createStatement();
              results = stmnt.executeQuery("SELECT * FROM table;");
         finally
              if ( results ! = null )
                   results.close();
              if ( stmnt != null )
                   stmnt.close();
              if ( conn != null )
                   conn.close();
    }The finally block ensures that even if an exception occurs we will release our resources. You have to make sure they're not null to avoid NullPointerExceptions.

  • 500 Internal Server Error OracleJSP: code too large for try statement catch

    We have an application which uses JSPs as front end and we are using Struts 1.1. When we run one of the JSP it shows the following error after executing .We are using OCJ4 server having version 9.0.4.0
    500 Internal Server Error
    OracleJSP: oracle.jsp.provider.JspCompileException:
    Errors compiling:E:\oracle\product\10.1.0\AS904\j2ee\home\application-deployments\VAS3006\vas\persistence\_pages\\_Requirement .java
    code too large for try statement catch( Throwable e) { 
    7194
    code too large for try statement catch( Exception clearException) { 
    44
    code too large for try statement try { 
    23
    code too large public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException { 
    The JSP/application runs okay on one machine (System Tesing machine)with OCJ4 server having version10.1.2.0 but throughs an error on other machine( Development machine)with OCJ4 server having version9.0.4.0.The question is why it is running on one machine ane giving error on other machine I am aware that there can't be more than 64kB of code between try-catch block .Total size of the generated JSP class in our case is 577KB.
    Is the problem because of different version of Application server OC4J?.Is it any fix for this? Or Can anyone please suggest a work around. Or is there a method by which the JSP generated code is split between different try - catch blocks rather than a single try-catch block.Utlimately We don't know the whether is it a problem with JVM or hardware .
    It would be really helpful if you would provide me with some suggestion and input.
    Regards
    Shyam

    Sir,
    I am aware of the limitations of JVM that it won't allow java code more than 64Kb in method but we are using different versions of Application server .Application is working okay with OC4J application server(10.1.2.0) but gives error on Application server with version 9.0.4.0. Is this a problem with OC4J application server 9.0.4.0. I had gone through the documentation ofOC4J 9.0.4.0.application server but it does not mention about the this bug/fixes.
    Please giude me on the same.
    Regards,Shyam

Maybe you are looking for

  • Not able to capture button event in pageLayout Controller

    Hi Guys, I have the following layout pageLayout ------------------------ pageLayoutCO (controller) ----messageComponentLayout (Region) ----------messageComponentText (item) ----------messageComponentText (item) ----------messageComponentText (item) -

  • Apple Script for indesign

    Hai all, i am trying to insert footnote and its contents for a particular xml element in "Adobe Indesign cs2" thru apple script. But i'm facing some problem. I'm able to select the xml element and its contents and i can insert footnote for that eleme

  • Switch to control mode is greyed out

    Decided to start a new discussion hoping someone can help. Hi. I have a problem with screen sharing where the option to "switch to control mode" is greyed out. I can only observe but not control the mac. I have 4 macs at home with the same set up "it

  • HOw do I get my computer to sinc my music to my new iphone

    Hiow do I get my computer to since my music on my new IPHONE

  • SQL SERVER 2012 cube deployment error

    I am a first time SQL server user trying to do the Analysis Services Tutorials. I am on the last part of Lesson 2 where the cube is deployed. Here is my error message. Note: I did have permission issues originally when trying upload AdventureWorksDW2