How to use same RESULT SET for two different events

hello friends,
I need to use same result set for two different events. How to do it.
here My code,
private void jComboBox1ItemStateChanged(java.awt.event.ItemEvent evt) {
// TODO add your handling code here:
try
String selstate,selitem;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:tourismdatasource","sa","");
selstate="select * from tab_places where state=?";
PreparedStatement ps=con.prepareStatement(selstate);
ps.setString(1, jComboBox1.getSelectedItem().toString().trim());
ResultSet rs=ps.executeQuery();
if(rs.next())
jTextField1.setText(rs.getString("place_ID"));
jTextField2.setText(rs.getString("place_name"));
jTextField3.setText(rs.getString("category"));
byte[] ba;
ba=rs.getBytes("image");
ImageIcon ic = new ImageIcon(ba);
jLabel6.setIcon(ic);
in=true;
catch(ClassNotFoundException cfe){JOptionPane.showMessageDialog(null, cfe.getMessage());}
catch(SQLException sqe){JOptionPane.showMessageDialog(null,sqe.getMessage());}
Now i need the same Result Set(rs), in another event(jButton6ActionPerformed),
private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}  how do i get dat resultset,
help me out

One post wasn't enough?
{color:0000ff}http://forum.java.sun.com/thread.jspa?threadID=5246634{color}
db

Similar Messages

  • Can I use same result set for two queries?

    Hi,
    Can I use the same result set for two queries?
    For example:
    ResultSet rs = null;
    rs = ps.executeQuery(query1);
    while (rs.next()) {
    rs = ps.executeQuery(query2);
    while (rs.next()) {
    Is it OK to use? or Is there any preformance issues?
    Appreciate your help.
    Thanks in advance.
    Prasad Vagolu

    Sure. You have a variable of ResultSet type. First you create a ResultSet and assign it to that variable. Then later you create another ResultSet and assign it to that same variable. Assigning an object reference to a variable takes essentially no time, and at any rate it isn't any faster to assign it to a different variable. Also, no matter whether you use one variable or two, you are still creating two ResultSets.
    However, you really should be closing your ResultSets after you finish using them. That's nothing to do with the assigning-to-a-variable question.

  • How to Use Same Navigation Panal for two different query

    Hello,
    My requirement is I have to display three different report in same web template in three different tab.
    I have created a custom web template with tab.
    in each tab i have assigned three different analyser table and assigned three different report in each data provider. once I run the report that works fine, each tab is displying each report seperately.
    The problem I am having here with navigation panal. Navigation panal is working ok for 1st report, but when I go to the 2nd  tab for  2nd report nev attribute itself is not displying. is there any special setting that i am missing?
    If any one know about the same pls help me
    Thanks
    Samit

    Hi
    When u select the Generic navigational block to ur template. select that and right click go to properties, in the lift side of u web item will come in that last but one option is Affected data providers is there double click on the list u will get the option
    Shashi

  • Using Same Bank Account for two different company code

    Can we use the same bank account number and ABA key for two different company codes? Both the company codes are in USA and with the same currency.
    Scenario is to separate one division of the company code to a separate company code. Client wanted to know if we can use the same bank account so that they dont have to open another bank account

    The system will allow the same ABA and bank account on two different company codes.  However, if you use electronic bank statement (EBS) functionality (or plan to use it in the future), you will not be able to import bank statements for the account if it exists on two company codes.  The EBS program uses the house bank/account ID tables to assign a company code to the bank statement.  If the account exists for more than one company code, the program cannot assign a company code and it will give an error.
    Regards,
    Shannon

  • How to use same jco destinations for two DCS

    Hi,
        I have a scenario where two dcs are using the same function module so i have a doubt that can we make jco destinations different for two dcs or not,plz help me
    Thanks,
    Santhosh.

    Vanama
    JCO Destination names are associated with models and not DCs. You can use same or different JCO destination names across different models.
    Typically if you are using a common set of function modules(RFCs) you might decide to create one or more model (each model consisting of logically related RFCs)in one DC and use it accross different DCs(By declaring the usage of the DC in other DC and declaring model usage in a particular component). This not only will save build time during design process, but will also bring in modularity and reusability. But its purely a design decision you need to make based on your requirement.
    kk

  • How to use Stock Category Group for two different configuration.

    Hi all,
    I want to use the stock category group to do this scenario:
    I have two process using the same location, the process A wants to consider Stock cat. Grp. 'ZSW' (SAPAPO/LOC3) so it will consider Stock using CC, CF and CE. The process B wants to consider Stock Cat. Grp. 'ZST' to consider only CC.
    My doubt:
    How can I do that setup to make different things according the process? I tried to do something in Planning Area (SAPAPO/MSDP_ADMIN) but doesnu2019t work.
    Can anyone help me?
    Thanks,
    -Ralph Veiga

    Hi Ralph Veiga,
    Indeed the stock category group is define at location level...
    I think your answer involves macros more than PA settings.
    First I will suggest to split the stock key figure into 2: one for CC, one for the other.
    For the CC, use the standard (cetegory group with CC only on the location master)
    Now you need to populate the second key figure with CF and CE.
    You should be able to built a macro using function PHYSICAL_STOCK() to get what you want.
    For sure yuo first need a way to check if you want or not the CF and CE. Here implement your own logic for exemple base on your product characteristics with either MAT(), MAT_C(), MAT_EXTRA(), MATLOC_C()...
    Else you can use a Z function in the macro to collect this data, but it involves ABAP coding.
    PS: you don't actually need to split the key figure into to, but I think it helps with visibility...
    Regards
    Julien

  • How can we use same material code for two different sales area

    Hello friendsu2026
    Hope you all doing well
    I am facing a problem and I will be thankful to all of you, for your suggestions
    Issue:
    I have a *material created in 3000/10/19 for domestic purpose *,now our company has decided to export it for that we have created a new sales are 3000/13/20 for export,we cannot create the salesa are as 3000/13/19 due to some  company issues,
    Is there any way how I can use the material already in 3000/10/19 into new sales area 3000/13/20.
    Will common distribution channel and division concept will be applicable here
    As the material is same,and we donu2019t want to go for any more new material code. *
    Thanks
    Siddharth Sharma

    Hi Sharma,
    when a material is used in domestic and exports.....i hope it should be seggreagated based on dist chnl.......but not division.
    because material is Division specific. it can be there in only one division. like mother child relation.
    that is the reason why...... it is maintained inside BASIC DATA...... but not in input screen while creating material master.[unlike dist chnl]
    because a material can be in multiple dist chnl....but not multiple division.
    I feel only alternative is creating new material if you are already decided to devide the sales by division for domestic and foriegn.
    Purpose of common dist chnl/div is to maintain pricing/condition in one common whenever you change master data.......
    hope this gives you the clarity
    regards
    Satya.SCM

  • Issues of using same enhancement set for different components

    Hi experts,
    I have an issue when using the same enhancement set(ZCRM_EHSET) for two different components IUICMD & IUICMRD. Component IUICMRD has two views IUICMRD/MainVS & IUICMRD/MeterReading and these views have been copied to Component IUICMD.
    Now, i am getting the following error, when i try to access AccountSearch view of component IUICMD
    Context initialization failed in view IUICMRD/MeterReading of UI Component IUICMD
    An exception has occurredException Class CX_SY_MOVE_CAST_ERROR - Source type \CLASS=CL_IUICMD_BSPWDCOMPONENT_IMPL is not compatible, for the purposes of assignment, with target type \CLASS=CL_IUICMRD_BSPWDCOMPONENT_IMPL
    Method: CL_IUICMRD_METERREADING_IMPL=>DO_INIT_CONTEXT
    Source Text Row: 10
    Let me know how i can solve this. Is there any precautions that i should have taken before using the same enhancement view for two different components.
    Thanks in advance.......................
    Regards,
    Prabahar

    Hi Bharathy,
    Thank you for the reply which helped me to come close to the solution.
    I hope you reply will solve the second part of my question where i get MOVE_CAST_ERROR.
    My first Question is still unanswered and i request you to provide solution if you have any. I worked on CRM 4.0 and CRM 2007 is new to me.
    My first question is below.
    I have two components IUICMD & IUICMRD. I have enhanced 4 views in the first component IUICMD using enhancement set ZCRM_ENHSET. There is no problem with that. But when i try to use the same enhancement set ZCRM_ENHSET for enhancing the second component IUICMRD, it's enhanceable in enhancement set.  But 2 views IUICRMD/Meterreading & IUICMRD/MainVS is also copied to first component and available as enhanceable views in First component.
    Is it the std behaviour that views from one component is copied to other when you try to use the same enhancement set? Kindly let me know if you faced similar situation.
    Best regards,
    Prabahar

  • How to map same sales unit for two keyfigures

    hi,
    i am using two key figure with reference of one sales unit(0SALESUNIT) but in update rules i am getting only one key figure the other key figure is not showing in update rules.
    i want to use the same sales unit for two different key figure.
    How to do it.
    Ankit

    Hi Ankit,
    if you have 2 key figures that are not defined as a reference of another key figure, but just use 0SALES_UNIT as their unit, you should have no problems with the update rules. The system will show both key figures in the update rule (or transformation).
    Also then the logic you map for 0SALES_UNIT will apply to both key figures in a transformation. For an update rule the same applies, unless you map the 2 key figures differently on purpose.
    I am not sure if your question was saying that you have defined a key figure as a reference to another key figure. If you have that situation, you should still be fine. If not try the approach above, after all there is not much benefit in creating a reference key figure in contract to creating a reference Characteristic (sharing master data, etc.)
    Best,
    Ralf

  • Same number range for two different series groups?

    Dear all,
    There are two scenarios
    1.Normal export under bond case, series group is 20 and number range maintained,running number is 300016
    2.Another scenario,where ARE1 document generation for Deemed exp customer(already customised) , series group is 30.
    But, client requirement is , for this second scenario also, system should pickup running number range of series group 20(under bond case)  as per excise legal requirement
    Ie running number is for series group 20 is 300016
    For the above deemed exp case (second scenario)it should pickup 300017
    And again when they do under bond case(first scenario), it should pick up 300018 like that
    Is it possible to maintain the same number range for two different series groups(20 and 30)?
    Even if you maintain the same number range for 30, as per running number range of 20
    Will the system update simultaneously the same number range for 20 and 30 series groups?
    Please suggest the way.

    With two different series groups, it is not possible to have the same number range. Even if you maintain it, they will be treated independently.
    Normally, you should not use different series groups if the same number range has to be used. In fact, the concept of series group has been developed to ensure that number ranges can be maintained separately.
    Regards,
    Aroop

  • Is it possible to use same data source for two info cube

    Hi,
    My Problem is in BW we can not have value of material at storage location level.In R/3 also value is maintained at plant level.
    Then we searched and we found out one hot to doc for summarized display of stock values on storage location level.
    Problem is that we have gone live in last December and we are using " 0AFMM_C02 " and it contains around 1,81,26,000 records. and according to note we have to use
    "0IC_C03".
    Both the cube uses same data sources for the data.So, how to get the data for "0IC_C03".
    and how to delete the data of existing info cube.And is it possible to delete data selectively from the info cube.
    Pls. help.
    Regards,
    viren.

    Hi,
    You can't create update rule from PSA.You can create from the infosource or from ODS or from cube to cube or ODS to ODS.
    In your scenario, what you can do is create update rules from the ODS to the new cube and then transfer the data from there. Or from the Infosource create rules to the new data target and then upload the full data and then set up the delta.
    Third option is to create update rules from the existing cube to the new cube and then load all the data one time. Then you can deactivate the update rules as that was needed only for 1 time data transfer.
    Cheers,
    Kedar

  • How can I define same Price Conditions for two different Sales Deals ??

    I need to define for the same price condition, lets say ZPMP, two different values or condition records, for two different sales deals and the same valid dates
    For example, Sales deal 1, ZPMP equal to USD 15 and valid dates from 04/15/08 to 04/30/08.
    Another condition record for Sales deal 2, ZPMP equal to USD 20 and valid dates from 04/15/08 to 04/30/08
    How can I do this.
    Thanks in advance.

    While creating condition tables, you have the option to create different key combinations. So if you want the system to take different condition records for different sales deals, there has to be a point of differentiation between those 2 sales deals.
    This can be done in one of the following ways:
    by giving customer specific prices
    by giving material specific prices for a particular customer etc
    All this can be defined as different key combinations while creating the condition tables. For each key combination, you can specify different condition records, so that the system is able to pull prices according to the requirement.
    But if the sales deals are entirely similar (that is even the validity dates, delivery dates etc are also same), and there is no differentiating factor, then you will have to manually input the prices.
    Do get back if you require more clarification. Please reward points if useful.
    Regards,
    Swapna

  • Same rule set for two apply processes

    Hi!
    Can anyone tell me whether it is possible to use the same rule set and all rules in it for two apply processes? It would be easy for me to use such configuration, because sometimes I create LCRs myself, sometimes Oracle captures them. They're exactly the same.
    And second question - I tried the above configuration, but the apply process for user created LCRs aborts when it sees first message. Error is: "ORA-00600: internal error code, arguments: [knlcfpactx:any_knlso], [], [], [], [], [], [], []". Oracle MetaLink and Google know nothing about this error. I also don't know if it's somehow connected with these rule sets or is it a problem within my procedure which creates LCRs.
    Greetings

    I'm answering myself. Yes, it is possible, to use the same rule set for different processes. It is said in the documentation. It is also possible to use one rule in several rule sets according to documentation.
    And it seems that it has nothing to do with my ORA-00600 error.

  • How to link the same horizontal page for two different vertical pages without duplicate them?

    Hey guys,
    Is there a way to link the same horizontal page on two different vertical pages without duplicate the horizontal page?
    I have a doublepage of a book splitted in two parts in different vertical pages but i want link the fullsized image in the horizontal page for both of them. Got that? hahaha
    Thank you all

    Confusing But interesing.
    I think it's possible. I have a idea. It will need one advanced trick.
    To explain it, I need test simply haha.

  • Same Apple ID for two different country accounts?

    Is it possible to use just one Apple ID for two different iTunes accounts? I've recently located to Australia from the uk and want to run an iTunes Store account in each but with just one apple id and email address. Can it be done?

    You have to be in a country to use its store (and an account can only have one billing address on it), so whilst you are in Australia you can only use the Australian store, you cannot use the UK store (including redownloading past purchases). You can either update your billing address on your existing account to have your Australian address on it, or create a new account with your Australian billing address on it
    Changing country on an account : Change the country of your iTunes Store, App Store, iBooks Store, and Mac App Store account - Apple Support.

Maybe you are looking for