Can java provide a follow/depend/attatch compiling warning?

I wrote a class called Query.It connect to database and return ResultSet.So user must manually call my method close() to close the ResultSet and Connection, otherwise resource will be avaliable.
But user maybe forget call the close() method.If codes are released,problem will occur.
For this reason I want java provides a compile warning if a important method is not called.
e.g. Codes maybe like this:
/**Start**/
class Query(){
ResultSet getResultSet(DataSource ds){
//Codes get resultset
return ResultSet;
void close() follow getResultSet(DataSource){
//Close databse
//Note: "follow getResultSet(DataSource)" is my idea.
class test{
Query query = new Query();
RsultSet rst = query.getResultSet();
//query.close();//#1
/**End**/
If user forget writing line #1 (to close Database,etc), java compiler will give a warning:
The method close() must follow method getResultSet!
You will get error when running.
Can java provide this function?
Thanks!

to mchan0 :
I konw you mean I can copy ResultSet to another Object.But if databse is very very large,ResultSet will use large memory.It is not we want.
e.g. our project database need to store 40,000,000 records.Once load large numbers records,server will crack.
So I can only use ResultSet.
If I wrong,please correct me.
Thanks

Similar Messages

  • Can Anybody provide me following documents

    Hello,
    Can any body provide me the following docs.
    1.Details configuration docs and TCodes for Foreign Trade configuration in SD.
    2.How to Configure workflow in SD point of view.
    If possible provide with some screenshots.That will be helpful.
    My email Id:[email protected]
    Regards,
    Bedayan Chakrabarty.

    Hi..
    Could you please send me the same on [email protected]?
    It will be very helpful to me also...
    Thanks in Advance..
    Regds
    MM

  • HT1923 I downloaded the latest iTunes version and now get the following error message: "This copy of iTunes is corrupted or is not installed correctly. Please re-install iTunes." Can anyone provide suggestions on what I should do next?

    I downloaded the latest iTunes version and now get the following error message: "This copy of iTunes is corrupted or is not installed correctly. Please re-install iTunes." Can anyone provide suggestions on what I should do next?

    Let's try a repair install of iTunes first.
    Restart the PC. If you're using Vista or 7, now head into your Uninstall a program control panel, select "iTunes" and then click "Repair". If you're using XP, head into your Add or Remove Programs control panel, select "iTunes", click "Change" and then click "Repair".
    Can you launch your iTunes now?

  • Can java code be compiled as an o. file and how?

    Some langyages produce o. files during the compiling process. Can Java do that?

    Some langyages produce o. files during the compiling
    process. Can Java do that?No, the Java compiler produces .class files. .o files contain binary
    date to be natively linked into an executable. .class files are loaded by
    the JVM and run by it.
    kind regards,
    Jos

  • What can Java inside cell phone do?

    hello,
    i would like to know what can Java inside my cell phone do? can it:
    1) run in a background
    2) initiate a phone call
    3) send an sms or receive an sms
    4) can it control bluetooth and to what extend
    what are things that java cannot do?
    thank you very much!

    Hi,
    J2ME apps run in sandbox mode. Things can be done using various APIs. To
    answer your specific questions:
    1) depends on the host device implementation, this is not defined by JCP
    2) AFAIK not (due to security). There might be an API however that allows you to
    do this on certain devices.
    3) Yeah, no problem. See http://java.sun.com/products/wma/
    4) Depends on APIs provided by device manufacturer. JCP defined http://www.jcp.org/en/jsr/detail?id=82.
    The things J2ME can not do are mostly features like accessing your phone
    book, use built-in camera (unless APIs are provided), floating point math
    operations, ...
    Reading J2ME related JSRs from http://www.jcp.org/ will give you the overview
    of what's defined and can be expected from all compliant phones. Other
    features may or may not be implemented.
    Hope this helps,
    Peter

  • Composite Provider with Time dependent master data

    Hi ,
    we have a infoset and due to some performance issues we are creating a composite provider to replace Info set and that Info set is having Time dependent master data objects  and DSO.. But when I was creating composite provider I do not see two time dependent  objects (Valid from and Valid to ) in composite provider. Composite provider does not have them/ is it a limitation? Appreciate if provide a input on this..  [We are in BW on HANA 7.4 with SP 7 environment]

    Hi Manohar Karunakaram
    I remember that there was the following limitation with Composite provider in terms of time dependent masterdata but it was a little old limitation.(some time in 2013)
    If temporal joins are required where the result set is depending on time-dependent master data, InfoSets have to be used since CompositeProviders can't provide that functionality.
    I am not sure whether it was solved in the latest release and dont remember an OSS where this was addressed.
    BR
    Prabhith

  • Why the following doesn't compile

    Can someone explain me why the following doesn't compile:
    class A<N extends Number> {
        public LinkedList<String> list;
        public N getN() {
            return null;
    class Test {
        Test(A a) {
            Number n = a.getN();
            String str = a.list.getFirst();
    }The compiler error is:
    incompatible types
    found   : java.lang.Object
    required: java.lang.String
            String str = a.list.getFirst();And if compiler "lose" generic info for some reason or other, so it don't know type "a.list.getFirst()" anymore and think that it's Object, then why it know type of "a.getN()"?

    DrClap wrote:
    I'm not convinced by that explanation. I've used List<Whatever> in classes which aren't themselves generic and it works as I and the OP expect it to work. And I don't really see the difference between a class which isn't generic and a class which could be generic but isn't. I also don't see why public members should be treated differently when accessed from outside a class compared to when accessed inside a class.
    If it indeed doesn't compile (and I haven't tested that myself) then no doubt there's a reason for that, this isn't one of those convoluted examples which the compiler writers could have missed without anybody noticing. It just doesn't seem to me that what jtahlborn wrote is actually the reason.Jtahlborn was correct with his explanation: whenever you use a generic type as the corresponding "raw type", the type loses all its generic features.
    Thus, the public member "list" loses its parameter of type String and becomes the raw type "List"
    The method "getN" loses its return type +"N extends Number"+ and yields simply a "Number".
    For a detailed discussion, see [http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html#110257]

  • How to create a simple idoc in practice? can you provide an example?

    how to create a simple idoc in practice? can you provide an example with full source code?

    Try with the follwoing steps
    Sending System(Outbound ALE Process)
    Tcode SALE „³ for
    a) Define Logical System
    b) Assign Client to Logical System
    Tcode SM59-RFC Destination
    Tcode BD64 ¡V Create Model View
    Tcode BD82 ¡V Generate partner Profiles & Create Ports
    Tcode BD64 ¡V Distribute the Model view
    This is Receiving system Settings
    Receiving System(Inbound ALE )
    Tcode SALE „³ for
    a) Define Logical System
    b) Assign Client to Logical System
    Tcode SM59-RFC Destination
    Tcode BD64 ¡V Check for Model view whether it has distributed or not
    Tcode BD82 -- Generate partner Profiles & Create Ports
    Tcode BD11 Getting Material Data
    Tcode WE05 ¡V Idoc List for inbound status codes
    Message Type MATMAS
    Tcode BD10 ¡V Send Material Data
    Tcode WE05 ¡V Idoc List for watching any Errors
    1)a Goto Tcode SALE
    Click on Sending & Receiving Systems-->Select Logical Systems
    Here Define Logical Systems---> Click on Execute Button
    go for new entries
    1) System Name : ERP000
    Description : Sending System
    2) System Name : ERP800
    Description : Receiving System
    press Enter & Save
    it will ask Request
    if you want new request create new Request orpress continue for transfering the objects
    B) goto Tcode SALE
    Select Assign Client to Logical Systems-->Execute
    000--> Double click on this
    Give the following Information
    Client : ERP 000
    City :
    Logical System
    Currency
    Client role
    Save this Data
    Step 2) For RFC Creation
    Goto Tcode SM59-->Select R/3 Connects
    Click on Create Button
    RFC Destination Name should be same as partner's logical system name and case sensitive to create the ports automatically while generating the partner profiles
    give the information for required fields
    RFC Destination : ERP800
    Connection type: 3
    Description
    Target Host : ERP000
    System No:000
    lan : EN
    Client : 800
    User : Login User Name
    Password:
    save this & Test it & RemortLogin
    3)
    Goto Tcode BD64 -- click on Change mode button
    click on create moduleview
    short text : xxxxxxxxxxxxxx
    Technical Neme : MODEL_ALV
    save this & Press ok
    select your just created modelview Name :'MODEL_ALV'.
    goto add message type
    Model Name : MODEL_ALV
    sender : ERP000
    Receiver : ERP800
    Message type :MATMAS
    save & Press Enter
    4) Goto Tcode BD82
    Give Model View : MODEL_ALV
    Partner system : ERP800
    execute this by press F8 Button
    it will gives you sending system port No :A000000015(Like)
    5) Goto Tcode BD64
    seelct the modelview
    goto >edit>modelview-->distribute
    press ok & Press enter
    6)goto Tcode : BD10 for Material sending
    Material : mat_001
    Message Type : MATMAS
    Logical System : ERP800
    and Execute
    7)goto Tcode : BD11 for Material Receiving
    Material : mat_001
    Message Type : MATMAS
    and Execute --> 1 request idoc created for message type Matmas
    press enter
    Thanks & regards
    Sreenivas
    Here Master Idoc set for Messge type MATMAS-->press Enter
    1 Communication Idoc generated for Message Type
    this is your IDOC
    Take a look at this guide.
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://www.allsaplinks.com/idoc_sample.html
    http://www.sappoint.com/abap/ale.pdf
    http://www.sappoint.com/abap/ale2.pdf
    http://www.sapgenie.com/ale/configuration.htm
    http://www.sappoint.com/abap/ale.pdf
    http://www.sappoint.com/abap/ale2.pdf
    http://www.sapdevelopment.co.uk/training
    http://www.sappro.com/downloads/OneClientDistribution.pdf
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    Create The Extension Segment
    Transaction: WE31
    The first step in extending an IDoc is to create the new segments that will go into that IDoc. There are some rules that you need to follow when creating the segments:
    - The name of each segment type must start with ‘Z1’
    - For each field in the segment you need to define a field name and a
    data element.
    - The data element for the segment structure must be of data type ‘CHAR’.
    How to create new segments:
    Run the segment maintenance transaction WE31.
    Type your new segment name, and click on Create.
    Define the fields of your segment:
    Field name
    Data Element for the field (from the ABAP dictionary).
    Do not change the Export length!
    Save the segment
    Run Segment -->Check to check the segment for consistency.
    Release the segment for transport. Select Edit -->Set Release. Note that the “Release’ column now has a check mark.
    Create the Extension IDoc Type
    Transaction: WE30
    After you create the segments to be added to the extension type, you can create the extension type itself. Execute transaction WE30, enter the extension name, select Extension type, and click Create. You now have three options:
    Create new type: Does not refer to other extension types
    Create copy: Copies info from an extension type that already exists
    Create successor: Extends an extension type from a previous release
    of R/3. You can only have one version of an extension type for
    each release.
    Enter the Basic IDoc type that this extension type will extend.
    The screen now shows the structure of the IDoc type you used as
    a reference.
    Position the cursor on one of the segments and click Create. This will insert an extension segment as a child of the selected segment.
    NOTE: A segment cannot appear more than once in an IDoc type! You must control the use of duplicate segments with the segment attributes (the next screen).
    The segment attribute screen appears. Enter the information and save.
    Extension segments should not be mandatory (for future upgrades), and will need to have minimum and maximum number of instances defined. This answers the question, “for each instance of the parent segment, how many instances of the child segment may we have?”
    You can press the Segment Editor pushbutton to view or change the segment definition.
    Create the new Message Type
    You can only use an extension IDoc type by assigning it to a message type. You can create a new message type for this.
    First the message type itself needs to be created.
    Transaction: WE81
    Create a new entry and save. Use SAP established customer naming conventions (good form is to start with a Z and retain the rest of the related SAP message type, so, for example, MATMAS becomes ZMATMAS).
    After creating the message type, associate it with the corresponding Basic IDoc Type and Extension Type. This relationship is used when IDocs are sent to or received from a partner to determine what segments are valid and what the hierarchy for those segments is.
    Transaction: WE82
    Create a new entry and enter the Message type, Basic IDoc type, Extension type, and Release, and save your data. Note: the release assignment is not valid for prior SAP releases.
    One message type can be associated with many basic IDoc types; however, you need a one-to-one relationship for distribution via ALE.
    regards,
    srinivas
    *reward for useful answers*</b>

  • Can anybody provide the SQL query to find the files uploaded in a particular folder?

    Hi All,
    Can anybody provide the SQL query to find the documents (document name) uploaded in a particular folder? While clicking on folder in
    GUI I'm hitting the Timeout error. I would like to find the files uploaded into this folder from SQLPLUS.
    Any help is greatly appreciated.
    With best regards,
    Nevin

    Nevin,
    Be great if we could know the version of Portal. For Rel. 1, here's the query
    select id,masterthingid from wwv_things
    where siteid = &site
    and cornerid = &corner
    &site - Content Area id
    &corner - Folder id
    if you don't know the folder id, use
    select id from wwv_corners where siteid = &site
    and name = &folder
    Hope this helps. I have run into this situation before. Usually, the culprits were
    one of the following:
    1. Junk Characters in description of item (caused due to Copy-Paste)
    2. Special Characters in the File name
    Hi All,
    Can anybody provide the SQL query to find the documents (document name) uploaded in a particular folder? While clicking on folder in
    GUI I'm hitting the Timeout error. I would like to find the files uploaded into this folder from SQLPLUS.
    Any help is greatly appreciated.
    With best regards,
    Nevin

  • For Tcodeme51n , there is no F4 help for one field, how can we provide F4 .

    Hi  ABAP Gurus,
    I am Ramu,
    For tcode me51n, there is one field, for that no F4 help. How can we provide F4 help for that particular field.
    Thanks in Advance.

    Hi Ram
    Pls try the below source code.
    Reward pts if help.
    regards
    Deepanker
    See the following ex:
    TYPES: BEGIN OF TY_MBLNR,
    MBLNR LIKE MKPF-MBLNR,
    END OF TY_MBLNR.
    DATA: IT_MBLNR TYPE STANDARD TABLE OF TY_MBLNR WITH HEADER LINE.
    data: it_ret like ddshretval occurs 0 with header line.
    At selection-screen on value-request for s_mat-low.
    Select MBLNR from mkpf into table it_mblnr.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    DDIC_STRUCTURE = ' '
    RETFIELD = 'MBLNR'
    PVALKEY = ' '
    DYNPPROG = ' '
    DYNPNR = ' '
    DYNPROFIELD = ' '
    STEPL = 0
    WINDOW_TITLE =
    VALUE = ' '
    VALUE_ORG = 'S'
    MULTIPLE_CHOICE = ' '
    DISPLAY = ' '
    CALLBACK_PROGRAM = ' '
    CALLBACK_FORM = ' '
    MARK_TAB =
    IMPORTING
    USER_RESET =
    TABLES
    VALUE_TAB = IT_MBLNR
    FIELD_TAB =
    RETURN_TAB = IT_RET
    DYNPFLD_MAPPING =
    EXCEPTIONS
    PARAMETER_ERROR = 1
    NO_VALUES_FOUND = 2
    OTHERS = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    IF SY-SUBRC = 0.
    read table it_ret index 1.
    move it_ret-fieldval to S_mat-low.
    ENDIF.
    Go through the test program.
    REPORT Ztest_HELP .
    TABLES : MARA.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS : P_MATNR(10) TYPE C.
    SELECTION-SCREEN END OF BLOCK B1.
    DATA : BEGIN OF ITAB OCCURS 0,
    MATNR TYPE MATNR,
    END OF ITAB.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MATNR.
    SELECT MATNR
    FROM MARA
    INTO TABLE ITAB
    UP TO 10 ROWS.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    RETFIELD = 'MATERIAL NUMBER'
    DYNPPROG = SY-REPID
    DYNPNR = SY-DYNNR
    DYNPROFIELD = 'P_MATNR'
    VALUE_ORG = 'S'
    TABLES
    VALUE_TAB = ITAB
    EXCEPTIONS
    PARAMETER_ERROR = 1
    NO_VALUES_FOUND = 2
    OTHERS = 3. 
    Reward pts if help.

  • How can we provide F4 help for parameter field.

    Hi All,
    How can I provide F4 help for parameter field.
    Regards,
    Amar

    hi,
    different ways of applying search help are :
    you can use anyone:
    1)   CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    or
    2) 
    can follow these simple steps for search help:
    go to se11==> put some name after ticking search help radiobutton==> create==>
    then tick " elementery search help " and press enter ===>then put description and table name in selection method ===>then put the field on which u want search help
    in search help parameter==> tick IMP EXP ==> write 1 in lpos and spos===>save and activate===> double click on table name ===>  select that field and press *search help tab* above===> then copy
    3 )
    methods of applyind search help:
    For search help sometimes we use MATCHCODE----->when we apply it directly to parameter or select option.they are obselete now ii.For search help sometimes we CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST' ??------->if we want to populate data of internal table as search help.
    iii.For search help sometimes we declare tablename-fieldname in selection?------>if that field in that table is having seach help or check table ..F4 will be avaliable directly.
    also:
    Fixed value of domain can also work as search help.
    i hope it will help u a lot
    thaks and regards
    rahul sharma

  • Can I provide a local jre download link?

    Legally, can I provide a local jre download link for our customers?
    I have a product that requires a specific JRE family (1.5) and I'd really like to provide a link during our web client discovery to a local copy (on tomcat) of the jre.
    I know that netbeans and eclipse etc, bundle the jre without any legal issues, but I'm worried that providing a link for web clients (even if they are on a local intranet) may not be legal.
    I'm hoping someone can point me in the right direction.
    Thanks in advance.
    -Dennis

    Good advice.
    The section of the license agreement of interest is:
    B. License to Distribute Software. Subject to the
    terms and conditions of this Agreement and
    restrictions and exceptions set forth in the Software
    README file, including, but not limited to the Java
    Technology Restrictions of these Supplemental Terms,
    Sun grants you a non-exclusive, non-transferable,
    limited license without fees to reproduce and
    distribute the Software, provided that (i) you
    distribute the Software complete and unmodified and
    only bundled as part of, and for the sole purpose of
    running, your Programs, (ii) the Programs add
    significant and primary functionality to the Software,
    (iii) you do not distribute additional software
    intended to replace any component(s) of the Software,
    (iv) you do not remove or alter any proprietary
    legends or notices contained in the Software, (v) you
    only distribute the Software subject to a license
    agreement that protects Sun's interests consistent
    with the terms contained in this Agreement, and (vi)
    you agree to defend and indemnify Sun and its
    licensors from and against any damages, costs,
    liabilities, settlement amounts and/or expenses
    (including attorneys' fees) incurred in connection
    with any claim, lawsuit or action by any third party
    that arises or results from the use or distribution of
    any and all Programs and/or Software.But to be more specific, the line that I'm worried about is:
    you distribute the Software complete and unmodified and only bundled as part of, and for the sole purpose of running, your Programs
    In my case, the client is using a browser, and would be logged in and then provided a link to our local download. All for the purpose of running our applets. However, there is nothing keeping the client from then moving on and using the JRE for something else.
    Therefore, I'm thinking that breaks the license.
    I think I am forced to provide a download link to Sun....
    /sigh
    -Dennis

  • Hi Iam new to hana I would like to learn the BW powered by HANA can any provide the documents.and I have gone through transports in hana what is meant by delivery unit?

    Hi Iam new to hana I would like to learn the BW powered by HANA can any provide the documents.and I have gone through transports in hana what is meant by delivery unit?

    Hi Sravan,
    Views do not store any data in HANA
    All data resides in tables
    To know how to join tables in Views, watch videos on SAP HANA Academy | SAP HANA
    For BW on HANA check:
    Blog: BW 7.4 on HANA in a Nutshell | SAP HANA
    SAP BW 7.4 SP5 on SAP HANA Overview and Roadmap
    Also follow BW on HANA Space on SCN SAP BW Powered by SAP HANA
    If you want to learn about HANA , check my blog:
    Want to learn SAP HANA?Where to Start?Certification?
    To know more about BW on HANA,check below blog for links to BW on HANA Materials:
    HANA Reference for Developers - Links and SAP Notes(Part-2) Updated 04.12.2013
    Regards,
    Vivek

  • Can Java reflect not only .Class file

    Hi' i'm newbie in this topic, i'm really appreciate if somebody can help me..cos i'm really stuck in here...
    My Problems are :
    1. i want to ask about this, can Java reflect from .java file?
    2. i'm using Eclipse IDE, i'm really interesting about how JTree or Package Explorer in Eclipse can always displaying update information about class structure? but .java files not compiled, how can? if Eclipse using reflection, .java files must be compiled first, correct me if i'm wrong?
    The fact is Eclipse don't have to compiled .java files to get the update information about class structure and displaying in JTree or package Explorer...how implement like this?
    what i mean like this :
    ex : if i type int x = 100; (not only int, it could be anything else..) at the working files, JTree or Package Explorer in Eclipse can always update the informasion about class structure, but .java files not compiled..
    i hope my question are easy to understand, i really need some help..
    Thanks a lot..

    hey, thanks for the answers, but i would like to ask :
    1) Eclipse performs background compilation of the Java sources, then performs reflection on those temporary classes++ if i'm using this way, how about the performance? seems that it will be compiled all the time right?
    2) Eclipse has access to the results of the Java source code parser, and can extract the information from the java syntax parser, before it gets to the compilation stage.++ how to implement this? what do you mean about java syntax parser?
    do you know where i can find any article about this?
    thanks a lot again...

  • Can you provides a Adobe LiveCycle Designer 8.0 download URL to me ?

    i search it in google and adobe.com
    but no result to me.
    I installed the LiveCycle Designer ES v8.2, but my Webdynpro tool could not find it
    so , i want get the version 8.0 to try.
    can you provides some download URL of the Adobe LiveCycle Designer 8.0  to me ?

    Hello
    [url]https://www.sdn.sap.com/downloads/netweaver/java/700/disclaimer.html[url]
    Regards,
    GLM

Maybe you are looking for