Creating and closing statements

Hi
I am new 2 JDBC and have a few doubts,
I need 2 move forward and backwards in the resultset, i am using the following declaration for that
stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
can i use the same declaration for the resultsets where i only need 2 move forward?
also i use different functions for running different queries, should i create n close statements seperately in each function, or should i create statement once n for all wen im loading the driver and use that in all da functions?
thanks a ton!

You can use it but before using it for second time. you have to make it null.No. No. No. Setting it to null does nothing particularly good for you. it makes the object eligible for garbage collection, which is going to happen anyway as soon as the Statement is reused.
You need to call close() before reusing a Statement (or PreparedStatement).
If your code has any chance of ever being used in a multi-threaded environment (such as a web service), then you should use local Statement objects. There are also a lot of good design reasons for making them local, but for a single-threaded application, you certainly could use a single global Statement.

Similar Messages

  • Created and closed A/R credit memo and A/R invoice

    Hi All,
    How to know who has created and closed A/R credit memo and A/R invoice ? I see
    the credit memo sometimes created based on A/R invoice but none the user's create
    it. Tks.
    Rgds,

    Hello,
    you could use change log, from tools --> change log to see who has closed or created a certain document. It is a history record tools. It is from ADOC, OUSR and other related tables.
    Rgds,

  • Cash Flow Statement - Opening and Closing balances!

    Dear Friends,
    I have created cash flow statement (Indirect Method) using T code FSI1 and FSI4 (Form)..........but i am not able
    Why wouldnu2019t Cash and Cash Equivalents at the End of the Year (Fiscal 2008) be EXACTLY equal to Cash and Cash Equivalents at the Beginning of Year (Fiscal 2009)...?
    How do we need to set up for Cash for Current year closing balances and Next year's opening balances....?
    Thanks,
    Elan N.

    Hi,
    I tested in ECC6.0 and i could able to do so, you try as mentioned below.
    In the output screen of MB5B, goto menu details > click on list > select save > select file > select spreadsheet. Here you can save tthe output in excel format.
    Regards,
    Prabu

  • Customer Statement with opening and closing balances

    Dear Forum,
    The users want to generate the Customer Statement with opening and closing balances like the traditional one. The statement now generated gives the list of all open items as on date, but the users want the statement with opening balances as on the date of the begining of the range specified and the closing balance at the end of the period for which the statement is generated. Is there a way to generate the same from the system.
    Thanks for the help.
    Regards,

    Hi,
    SPRO> Financial Accounting (New) > Accounts Receivable and Accounts Payable > Customer Accounts > Line Items > Correspondence > Make and Check Settings for Correspondence
    You can use the program RFKORD10 with correspondance type SAP06 for your company code
    This program prints account statements and open items lists for customers and vendors in letter form. For account statements, all postings between two key dates, as well as the opening and closing balance, are listed.
    Regards,
    Gaurav

  • Connection/ResultSets/Prepared Statement opening and closing

    Hi all another question that was sparked by a thread that I recently read. I believe it was duffmo who got the code from jverd. The code I am referring to is to have an open and close connection specified in a Utility or Database class. I wanted to know if there was any issues with having methods that open and close connections/result sets/ preparedStatements. Currently I am putting the finally blocks inside each of my methods. There is obvious benefits to putting the methods in a class on their own (namely code re-use) but I wanted to know if there are any dangers. (This may seem like a dumb question, but I've found from experience it's the things that you don't know that will cost you loads of time).
    thanks again.

    Hi all another question that was sparked by athread
    that I recently read. I believe it was duffmo who
    got the code from jverd. Generally speaking it's fine.
    But as always you may have some long term design
    issues to think about. If you build a simple
    framework that consists of one class and that does
    all that your program does then great.
    Once you start add more complexity though you'll want
    to be careful that you aren't reinventing the Spring
    wheel or even ending up implementing your own
    connection pool. Both of which, judging from posts
    here seem to happen from time to time.
    So I guess all in all, yes it's much better than
    scattering the code all about but depending on what
    you are going to be doing with it you may want to
    look at the various ORM frameworks to see if they are
    really the direction you should be going in.Thanks for the information cotton. I just wanted to make certain that it was a sensible thing to do. When I had first asked about connections I was told they should be opened an closed in the same spot, unfortunately I took that explanation a little too much to heart, and started opening and closing every connection resultset and prepared statement in each of the DAO classes that I was using.
    Guess it's going to be a bit of work to refactor, but worth it for the cleaner code that will result.

  • Opening balance and closing balance on Receivables Customer Statement repor

    I need an opening balance and closing balance of the customer statement in one report. Currently I developed a custom Customer statement report in report builder 6i. I developed a custom procedure to retrieve the previous statement balance. I’m able to successfully retrieve ending balance statement with sysdate but if I go back to previous date or previous statement date then I’m not getting the right ending balance of the report.
    Even the seeded api arp_customer_aging provides the ending balance for sysdate but not for previous dates because this api always looks back to amount due remaining column(ar_payment_schedules_all).
    Did any one ever develop a custom logic to get previous balance and ending balance on one single customer statement?

    Hi,
    I am working on the same logic. My program loads opening and closing balance and a list of items everyday. The GL_balances table gives you current balance but if you want the previous balance, you have to use : "gl_daily_balances" table and provide accounting_date for which you want the balance.
    Hope this Helps!
    Yogini

  • Specs and workflow for creating opening/closing titles for video

    I'm trying to create specs/workflow for videos that I will be adding opening and closing titles to (black background with colored text), using QuickTime Player 7 (Pro).
    The videos are .mov, AVC coding, 1280x720, millions, 30fps, a sample video had a data rate of 7,463 kbits/second.
    I created 1280x720 300dpi (perhaps I should have used 72dpi?), saved as a .jpg (highest quality), then copied the .jpg contents into a QuickTime Player 7 (Pro) blank document multiple times until I had enough frames for my need. The resultant video was very large; 339,743 kbps/second. I then exported to H.264, which brings the data rate down to only 214 kbits/second (and looks fine) and then copied that into the head of my AVC coding video.
    Questions:
    1) When I exported to H.264, the x pixels increased by 6, to 1286. After pasting that video into the AVC coding (1280x720) video, the resultant movie is 1280x720. Did my graphic get compressed by 6 pixels horizontally?
    2) Does my method of converting the huge graphic movie to H.264, and then pasting it into the AVC coding make sense? The combined video has AVC coding, according to Movie Inspector; does the H.264 of the graphic get converted automatically? Any better way to approach creating my titles?
    Note: these AVC coding videos may get converted to H.264 for some use, but for now, I'm keeping the highest quality (source) video I have to work with.
    Thanks,
    Bob

    "First, tell use why you're not using FCP's titling and keying capabilities."
    I don't own FCP.
    "Then, explain why you're doing it this way."
    I'm able to create graphics with plenty of control in a graphics program (PhotoShop in this case).
    "There is no dpi in video, there are only pixels."
    Sorry, I posted my thread then realized I left out a bit of info, but couldn't edit the post. I should have written that I created my graphics file in PhotoShop, hence the dpi reference.
    "A black background for text is not the same as using an alpha channel."
    OK. The portion of my video with titling stands by itself; that is, I'm not overlaying titles on existing video. Is there a use for alpha channel if I'm working up standalone title video frames? Uses less data rate?
    It seems from your inference I would be best served by purchasing FCP, so I'll probably take that advice and buy it.
    From a general video production point of view, I'd still like to learn more about creating titles in a graphics app and bringing them into QT Player; what format to bring them in as (e.g., H.264 into an AVC coding video, as I've done, or ?), and what happens when my graphics video gets converted from 1280x720 to 1286x780 (AVC export to H.264), and then brought into an AVC codec movie, and the movie remains at 1280x720-- does the graphic get horizontally widened, or the vertical compressed? Thanks.
    Bob

  • How to create a query to see Opening stock and closing stock as on particul

    Hi All,
    How to create a query to see Opening stock and closing stock as on particul.
    Regards
    Albaik

    Hi,
    In BI 0IC_C03 will provide u the  required information and also having standard queries provided by the SAP.
    Plz find the list of Queries provided by the SAP.
    =======================================================================================================
    Inventory turnover      0IC_C01_Q0001
    Range of coverage - quantity      0IC_C01_Q0002
    Range of Coverage - Value      0IC_C01_Q0003
    Range of coverage of finished goods - quantity      0IC_C01_Q0004
    Range of Coverage of Finished Goods - Value      0IC_C01_Q0005
    Range of coverage of raw materials - quantity      0IC_C01_Q0006
    Range of Coverage of Raw Materials - Value      0IC_C01_Q0007
    Obsolete Stock on Hand      0IC_C01_Q0008
    Period-dependent requirement coverage      0IC_C01_Q0009
    Value of stock on hand      0IC_C01_Q0010
    Quantity of stock on hand      0IC_C01_Q0011
    Material consumption      0IC_C01_Q0012
    Material Movements      0IC_C01_Q0013
    Consignment stock: receipts and issues      0IC_C01_Q0014
    Valuated stock: receipts and issues      0IC_C01_Q0015
    Material stock and movements      0IC_C01_Q0016
    Material Movements (Healthcare)      0IC_C01_Q0020
    Material Consumption (Healthcare)      0IC_C01_Q0021
    Material Availability      0IC_C01_Q0022
    Inventory Turnover Frequency (Value)      0IC_C01_Q0023
    Consignment Stock Received and Issued per Unit      0IC_C01_Q0024
    Material Consumption (Quantity)      0IC_C02_Q0001
    Valuated Stock Receipts and Issues (Quantity)      0IC_C02_Q0002
    Range of Valuated Stock (Quantity)      0IC_C02_Q0003
    Inventory Turnover      0IC_C02_Q0004
    Receipt and Issue Consignment Stock at Customer      0IC_C03_Q0001
    Receipt and Issue Quality Inspection Stock      0IC_C03_Q0002
    Vendor Consignment Stock Receipt and Issue      0IC_C03_Q0003
    Receipt and Issue Stock in Transit      0IC_C03_Q0004
    Receipt and Issue of Blocked Stock      0IC_C03_Q0005
    Valuated Stock      0IC_C03_Q0006
    Stock in Quality Inspection      0IC_C03_Q0007
    Stock in Transit      0IC_C03_Q0008
    Blocked Stock      0IC_C03_Q0009
    Vendor Consignment Stock      0IC_C03_Q0010
    Consignment Stock at Customer      0IC_C03_Q0011
    Stock Overview      0IC_C03_Q0012
    Stock Overview (as of 3.1 Content)      0IC_C03_Q0013
    Quantities of Valuated Project Stock (as of 3.1 Content)      0IC_C03_Q0014
    Valuated Stock (as of 3.1 Content)      0IC_C03_Q0015
    Quantities of Valuated Sales Order Stock (as of 2.1 Cont.)      0IC_C03_Q0016
    Inventory Turnover      0IC_C03_Q0017
    Days' Supply      0IC_C03_Q0018
    SUS: Vendor Consignment Stock      0IC_C03_Q0019
    Scrap      0IC_C03_Q0020
    Inventory Aging      0IC_C03_Q0021
    Stock Overview - extended      0IC_C03_Q0022
    Demand Supply Match      0IC_C03_Q0023
    Warehouse Stock Analytics – Inventory Turnover      0IC_C03_Q0024
    Warehouse Analytics - Obsolescence and Variance      0IC_C03_Q0025
    Stock Overview: Materials      0IC_C03_Q0030
    Average Stock Value Over Time      0IC_C03_Q0031
    Stock Overview Over Time      0IC_C03_Q0032
    Range of Coverage Over Time      0IC_C03_Q0033
    ==================================================================================================
    Regards
    Ram.
    Edited by: Ramakanth Deepak Gandepalli on Jan 18, 2010 8:06 AM

  • I have an ipad mini. From one moment to another a document that was created and used on pages app ( on the ipad mini) does not want to open ( When pressed it states " document cant be opened). How can I make this document open again?

    I have an ipad mini. From one moment to another a document that was created and used on pages app ( on the ipad mini) does not want to open ( When pressed it states " document cant be opened). How can I make this document open again?
    I have tried back ups and  restoring, resetting, and even updating the pages app. And nothing has worked.

    I have an ipad mini. From one moment to another a document that was created and used on pages app ( on the ipad mini) does not want to open ( When pressed it states " document cant be opened). How can I make this document open again?
    I have tried back ups and  restoring, resetting, and even updating the pages app. And nothing has worked.

  • When creating a custom SearchPlugin, is it possible to add more code such as uppercase conversion of the SearchText and IF statements that change the URL depending on what is typed?

    When creating a custom SearchPlugin, is it possible to add more code such as uppercase conversion of the searchTerms and IF statements that change the URL depending on the searchTerms? Every time I try to add something firefox doesn't want to add it as a search plugin. I need to create a more powerful search tool for personal use.

    I've found some external software applications that will do it, so that leads me to believe its not possible within ID CC.

  • "Setup encountered a problem while validating the state of Active Directory: Exchange organization-level objects have not been created, and setup cannot create them because the local computer is not in the same domain and site as the schema master. Run se

    Team,
    I am trying to Install Exchange on my Lab, getting below error
    message.
    The Schema Role is installed on Root Domain and trying to install
    exchange on Child domain.
    1 Root Domain - 1 Child domain. both are located on single site.
    “Setup encountered a problem while validating
    the state of Active Directory: Exchange organization-level objects have not been created, and setup cannot create them because the local computer is not in the same domain and site as the schema master. Run setup with the /prepareAD parameter and wait for
    replication to complete.”
    Followed below articles:
    http://support.risualblogs.com/blog/2012/02/21/exchange-2010-sp2-upgrade-issue-exchange-organization-level-objects-have-not-been-created-and-setup-cannot-create-them-because-the-local-computer-is-not-in-the-same-domain-and-site-as-the-sche/
    http://www.petenetlive.com/KB/Article/0000793.htm
    transferred the schema roles to different server on root domain, still no luck.
    can someone please help me.
    regards
    Srinivasa k
    Srinivasa K

    Hi Srinivasa,
    I guess, you didn't completed the initial setup schemaprep and adprep before starting the installation. You can do it as follows:
    1. Open command Prompt as administrator and browse to the root of installation cd and run Setup.exe /PrepareSchema /IAcceptExchangeServerLicenseTerms
    After finishing this,
    2. Setup.exe /PrepareAD /OrganizationName:"<organization name>" /IAcceptExchangeServerLicenseTerms
    3. To prepare all domains within the forest run Setup.exe /PrepareAllDomains /IAcceptExchangeServerLicenseTerms. If you want to prepare a specific domain run Setup.exe /PrepareDomain:<FQDN of the domain you want to prepare> /IAcceptExchangeServerLicenseTerms
    4. Once you complete all of the 3 steps, install the pre-requisities for Exchange 2013
    5. Finally, run the setup program
    Hope this will help you
    Regards from Visit ExchangeOnline |
    Visit WindowsAdmin

  • Weblogic JTA timeout and PreparedStatement cache problem (Closed Statement)

    Hello,
    I am facing up a problem using a Weblogic connection pool with a PreparedStatement.
    Here is the environement :
    - Weblogic application server 10.3
    - JDBC connection pool with Oracle Thin driver (from server library) - all parameters by default i.e. StatementCache size = 10
    - JTA transaction timeout = 30s
    The problem is : if a prepared statement ends because of a JTA timeout, I receive the following stack exception/ stack trace
    java.sql.SQLException: The transaction is no longer active - status: 'Rolling Back. [Reason=weblogic.transaction.internal.TimedOutException: Transaction timed out after 33 seconds
    BEA1-000D8AE7230EFAA3EDC9]'. No further JDBC access is allowed within this transaction.
    at weblogic.jdbc.wrapper.JTSConnection.checkIfRolledBack(JTSConnection.java:178)
    at weblogic.jdbc.wrapper.JTSConnection.checkConnection(JTSConnection.java:188)
    at weblogic.jdbc.wrapper.Connection.preInvocationHandler(Connection.java:92)
    at weblogic.jdbc.wrapper.Connection.clearCachedStatement(Connection.java:814)
    at weblogic.jdbc.wrapper.PreparedStatement.clearCachedStatement(PreparedStatement.java:1357)
    and then, if we try to re-execute immediately the same operation (*same statement* but new request, new thread, new JTA transaction ...) we receive without delay the following exception :
    java.sql.SQLException: Closed Statement
    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:173)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:229)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:403)
    It seems like a bug in the caching mechanism of Weblogic, the 1st stack trace shows method from the statement cache implementation, I presume weblogic is trying the clear the statement from the cache after the iniitial TimedOutException (SQLException), but as the JDBC connection is unusable at this point, the clearing fails and the statement remains in the cache but is physically closed by JDBC.
    1st question, why weblogic does need to call JTSConnection.checkConnection() for clearing a statement from its internal cache, it is a pure java memory operation isnt'it ?
    2nd question : How to solve the problem without setting the StatementCache size to 0 (I tried, it solves the problem)? I don't want to disable completely the Weblogic statement caching, I have a small PreparedStatement called very frequently.
    Thanks for any help

    The main issue is that the transactional context that is supposed to underlay the JDBC code being executed,
    has gone away. Indeed, any DBMS changes that may have been made by your code so far, have been rolled
    back and are gone. Your code should not be trying to continue JDBC as normal, and WebLogic is trying to stop
    you. The control flow should go back up to the location where the transaction was initiated, so as to restart from
    the beginning if that is what is desired, including getting a new JDBC connection and remaking all the statements
    etc.
    HTH,
    Joe
    Edited by: Joe Weinstein on Dec 3, 2010 9:12 AM

  • Opening and closing stock

    Hi,
        We have a requirement in which a Customized report has to be developed. The report needs to display the opening stock , Total reciept, consumption and closing stock for supplier wise material.
       We came across a standard report MB5B in which all these values are available. However inorder to display these values in a customized report we require a standard function module. Please provide us a std function module that can solve the purpose.
    If the std module is not available (i dnt come across one) kindly porvide an alternaitve for the same.
    Regards,
          Milan Thaker

    Hi,
    Use Submit Statement to get the output data from MB5b.
    Ex:
    Create selection screen with required filelds and use like this
    SUBMIT RM07MLBD with MATNR in r_matnr
                            with LGBST eq ''
                            with BWBST eq 'X'
                            with datum in datum
                            with bukrs in bukrs
                            with werks in werks
                            with lgort in lgort
                            with charg in charg
                            with bwtar in bwtar
                            with bwart in bwart
    Rgds
    Aeda

  • Opening and closing a cursor

    I have read that, the cursor in a for loop will be opened and closed automatically. Will that be the same in the case of the code given below, where we are declaring the cursor before the for loop ?
    -- Code
    create or replace procedure test
    as
    begin
    -- some statements
    -- begin of another block
    declare
    cursor v_cursor is Select * from Employee;
    begin
    for cur in v_cursor loop
    -- loop statements
    end loop;
    end;
    end test; -- end of procedure
    Thanks in advance ..

    for more information on cursor for loop follow the link
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96624/01_oview.htm#767

  • Inventory Opening and Closing Stock

    Hello Experts,
    How can i get the inventory opening stock  and inventory closing stock in SAP business One so as to reflect the same in the Profit and Loss Statement and  Balance sheet..
    Divya Chaudhary

    Hey
    First create a P&L template
    2)add child level as assign name "Opening Stock" LEVEL=4
    2)add child level as assign name "Stock Detail" LEVEL=8
    2)add child level as assign name "stock value" LEVEL=12
    now double click on "stock value" and assign GL which u made in Chart of account as Assest e.g hardware,software
    *note at level 12 only we can assign GL so it necessary to move hirearchy upto level=12
    and then update yr template
    Thanks
    King Kevin

Maybe you are looking for

  • How to read instrument driver dll files

    Hello, How to read .dll files of an instrument driver? What is the programming methodology followed in dll files? I will be grtaeful to you if someone can point me a way to do this. Thanks, Ananda H S

  • Adding Custom command in Call Sidebar in Lync Client 2013

    I created a Lync custom command, that appears when user right click on the contact. My application is a telephony integration. I want my option to be appear in Call side menu when right clicking on the contact. Is there any way I can achieve this ? I

  • Supplimentary invoice send by vendor

    hi, how to post supplimentary A/P invoice. suppose i have procure one material with pricr Rs 1 today ,so for 10 qty vendor sendmi invoice of rs 10, but at the end of the month raw mat price increases i.e Rs 2 , so again for 10 qty vendor send mi one

  • Show/Hide group tree always present when deployed w/ weblogic to the web

    <p>http://diamond.businessobjects.com/node/749</p><p>Please respond in either post if you know how to remedy this.</p><p>-Sam <br /></p>

  • How do I copy from my CD player to my M

    Hi, I've just brought my MP3 home and chose it b/c the store told me I can copy directly from my CD player to the MP3 - how do I do this? Can I select particular tracks or would it copy the whole CD? Any help is much appreciated