How Can i get the data From A Table that use DefaultTableModel

Hi and sorry for my bad english. The problem that i have is that i used this code to fill a table. Now i want when i select a row and click in a button , get the value of that row that i select so then i can update or delete that data in my dataBasesServer.
private void consulta(){
          Connection c = ConectarSQL.conexionSQL();
          try {
               Statement s = c.createStatement();
               ResultSet ar = s.executeQuery("Select Apellido, Nombre FROM Personas");
               DefaultTableModel modelo = new DefaultTableModel();
               this.Tabla.setModel(modelo);
               modelo.addColumn("Apellido");
               modelo.addColumn("Nombre");
               while (ar.next()) {
                  Object [] fila = new Object[2];
                  for (int i=0;i<2;i++)
                     fila[i] = ar.getObject(i+1);
                  modelo.addRow(fila);
          } catch (SQLException e) {
               // TODO Auto-generated catch block
               e.printStackTrace();
}

Dont worry kevinaworkman, the thing is that a read it and is really usefull, but i was looking other kind of solution. But i welcome your answer and interested to solve my problem.
I find the answer.
To retrive the data i have to use the following instruction:
Tabla.getValueAt(Tabla.getSelectedColumn(),Tabla.getSelectedRow);

Similar Messages

  • How Can we get the data from Non-SAP to SAP in WebDynpro

    Hi,
    I hope u understand my query, How can we get the data from Non-SAP to SAP thru WebDynpro Programming.
    Help out with the steps for getting the data or procedure.
    Regards,
    Mutyapu

    You can expose the APIs in the Non-SAP backend as Web Services, and consume them in SAP by creating an Enterprise Proxy. Then these can be called just like normal class methods from Web Dynpro.
    Regards,
    Nithya

  • How can i get my data from an application that deleted from my iphone

    how can i get my data from an application that deleted from my iphone????

    Which application?
    With many applications, when deleting the app the app's data is deleted with it.

  • How can i convert the data from mutiple-table to the other database(MSSQL)?

    Dears,
    How can i convert the data from mutiple-table to the other database such as MS-SQL?
    I have a third party system based on MS-SQL 2000.
    Now we want to make a integration between SAP R/3(Oracle) and SQL server.
    When my user releases the purchase order in R/3, the application we coded will convert the releated data to the temp database on the SQL server.
    But i don't know which tools will help me reach the purpose.  BAPI, LSMW, IDoc... ???
    Would anybody tell me which way is better and how to do?
    Thanks a lot!
    Kevin Wang

    Hello Kevin,
    The question to use which method depend on your detail requirements. If you use BAPI, you need to find which Bapi can provide the data you want. Bapi normally use as a function called by external system. So you need to develop an external program like VB/Java to call this Bapi and move it to SQL. LSMW is use when you want to upload data from an external system to SAP. So it does not serve your requirement. Idoc can be use to export data to an external system. Again like Bapi, you need to find what Idoc can provide the data you want. However, it does not any programming from the external system. If I were you, based on your requirements, I think writing an Abap program that read the data you want and download it to NT/SQL server will be faster and easier.

  • How can i get the data from database & add them as a link

    Hi,
    how can i get a data from a database(DB2) and that data will be having a file so i should make them as a link.i tried it in jsp .
    <%
    Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
    Class.forName("COM.ibm.db2.jdbc.net.DB2Driver");     
    response.setContentType("text/html");
    Connection conn = null;
    conn = DriverManager.getConnection("jdbc:db2:spintran");
    Statement stmt = conn.createStatement();
    stmt.executeQuery("set current schema tut");
    ResultSet rs = stmt.executeQuery("select * from tutorial");     
    %>
    Type Of the Category : &nbsp&nbsp&nbsp
    <%
         while (rs.next())
         String desc = rs.getString(1);     
         out.println(desc);
    %>
         <A HREF = "<%=desc%>"><%=desc%> </A>
         <%
         %>
    but it is not working.how can i link.
    thank you.

    what is desc? is it the file name ? whats the data type of desc in db? INFILE?
    if desc is just the name of the file, then make sure that such a file exists in the proper folder.only then the link works..
    that is, if desc is 'a.jpg' then a.jpg should be existing in the same folder as your html is.

  • How can i get the data from the weblink

    Hi All,
    Good Afternoon,
    i create a page with picklist,
    that picklist contains so many currencies like(USD,AED,BSD----------)
    when ever i am selecting the currency from that picklist,
    that time i want to get the current exchage rate from this link
    http://www.oanda.com/convert/classic
    how can i get the current exchage rate from that link.
    pls give me the gudaincee.
    i hope u will help me.

    Hi Gaurav,
    Below given link gives a nice demo of integrating web service with OAF. (For using captcha user verification service).
    [http://oracle.anilpassi.com/integrate-oa-framework-with-web-service-2.html]
    However, using web services will cost little extra effort of learning SOAP and wsdl.
    Please let me know if you find any difficulties related to web services.
    Abdul Wahid

  • I sync'd my Iphone with itunes and all my data on my Iphone was erased.  How can I get the data from my Iphone back?

    I am a previous user of itouch and sync'd it with itunes on my PC using windows 7, itunes v10.  Bought my first iphone and started using it: I entered contacts, photos, apps, etc.. I sync it for the first time and itunes removed all my data from my Iphone and put my old data from Itouch on the iphone.  How can I get my Iphone data back?

    I am a previous user of itouch and sync'd it with itunes on my PC using windows 7, itunes v10.  Bought my first iphone and started using it: I entered contacts, photos, apps, etc.. I sync it for the first time and itunes removed all my data from my Iphone and put my old data from Itouch on the iphone.  How can I get my Iphone data back?

  • Hi how can i fetch the data from tree table

    Hi i am designing a UI in which i am creating a java tree table as on sun java site http://java.sun.com/products/jfc/tsc/articles/treetable2/index.html now i have to fetch the perticular column value on the mouse click.I have implemented mouse listener and on mouse clicked event I tried :
    Object obj=tableInputOutputEntities.getValueAt(tableInputOutputEntities.getSelectedRow(),tableInputOutputEntities.getSelectedColumn());
    as we usually do in case on JTable but it is also throwing null exception. Again after going through forum i found some code to get the current row and current column selected values and tried with getValueAt(int,int) method but still it is throwing nulll pointer exception. Please help me out.
                         public void mouseClicked(MouseEvent e)
              Point p = e.getPoint();
              int row = treeTable.rowAtPoint(p);
              int column = treeTable.columnAtPoint(p);
              Object obj=treeTable.getValueAt(row,column);
              System.out.println("Object value: "+obj.toString());               
                                }Regards
    Naxy

    Hello Kevin,
    The question to use which method depend on your detail requirements. If you use BAPI, you need to find which Bapi can provide the data you want. Bapi normally use as a function called by external system. So you need to develop an external program like VB/Java to call this Bapi and move it to SQL. LSMW is use when you want to upload data from an external system to SAP. So it does not serve your requirement. Idoc can be use to export data to an external system. Again like Bapi, you need to find what Idoc can provide the data you want. However, it does not any programming from the external system. If I were you, based on your requirements, I think writing an Abap program that read the data you want and download it to NT/SQL server will be faster and easier.

  • My hard drive crashed with no backup.  How can I get the data from iCloud onto my Mac?

    My hard drive went bad and needed to be replaced and I've lost everything that was on it (no backup - I know, I know...).  Fortunately much of my data was backed up either on icloud or my ipad but I haven't been able to find any information about restoring it FROM icloud or ipad TO my Mac, only about how to restore to an ios device.  I am running Lion.  Thank you!

    I guess what I meant to say was that I can log on to icloud to see my contacts, calendars, etc but is there a way to get that data onto my computer?  In other words, how do I associate my new hard drive with my icloud account?  I am probably not phrasing this properly - sorry.  Three days ago (pre-crash) my desktop was configured to reflect my icloud info but I don't know how to make it do so again...does this make sense

  • How can i Delete the data from three tables at a time  using same key.

    I am New to Oracle ADF, I have a Requirement Like these, I have three tables like Employee,Salaries,Teams all of these are having one common EmpNo as common attribute, I have Search form these will return the all the employees related to that search query, when i click on Delete button the particular employe Data should delete from all the three tables based on the EmpNo.
    Any Help is appreciable..

    1) The easiest way is to mark the foreign key constraints from SALARIES to EMPLOYEES and from TEAMS to EMPLOYEES as ON DELETE CASCADE. The DB server will then delete the necessary rows whenever you delete an employee row.
    2) Another way is to implement a Before-Delete-Row DB trigger on the EMPLOYEES table where you can delete the related rows in the other tables (have in mind, that if you have foreign keys you may get a Mutating Table Exception, so this approach might be not very good).
    3) An ADF way is to implement a custom EntityImpl class for the Employee entity and to override the remove() method where you can lookup the related TeamMember and Salary entities (through EntityAssoc accessors) and invoke their remove() methods too.
    4) Another ADF way is to implement a custom EntityImpl class for the Employee entity and to override the doDML() method where you can delete the necessary rows in SALARIES and TEAMS tables through JDBC calls whenever a DELETE operation is being performed on the underlying Employee entity.
    Dimitar

  • How can I get the data back from my game

    How can I get the data back from minecraft if I deleted the app and bought with a different Apple ID

    No, they are tied to the ID that purchased them, and cannot be transferred to anyone else.

  • How can I get the date of the next monday from the currentday?

    How can  I get the date of the next monday from current day? Please advice.
    mayooran99

    Hi mayooran,
    Please try the following code
    DateTime nextMonday = DateTime.Today.AddDays(((int)DateTime.Today.DayOfWeek - (int)DayOfWeek.Monday) + 7);
    Best regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Can anyone let me know how can i get the ouput from BW in .txt format.

    Can anyone let me know how can i get the ouput from BW in .txt format. See we can get output as Excel(i.e BEX) and manually convert it into txt format. I need a direct or automated way to do the same.no human intervention.
    mail me at [email protected] or post answer in sdn.

    Please do not multiple post across forums..
    how can i save the data in BEX reports in .txt format automatically
    This helps in keeping track of answers and avoids the issue of repeated answers across forums...
    Please close one of the threads as answered and provide the link that you want to follow
    Arun

  • How can we export the data from OAF Page to Excel instead of .csv or .txt

    Hello,
    How can we export the data from OAF Page to Excel instead of .csv or .txt
    When i click on the export button it is exporting to txt file, But i need to export the data into Excel by default
    Please help me
    Thanks in advance
    Thanks,
    Raju
    We have changed the below profile option to get the data in excel by default
    Profile Name Export MIME type
    Profile Code FND_EXPORT_MIME_TYPE+
    Existing Value: text/tab-separated-values+
    Change as: Excel
    Thank you,
    Raju
    Edited by: 1006649 on May 21, 2013 10:55 AM

    We have changed the below profile option to get the data in excel by default
    Profile Name Export MIME type
    Profile Code FND_EXPORT_MIME_TYPE+
    Existing Value: text/tab-separated-values+
    Change as: Excel
    Thank you,
    Raju

  • How can I extract the data from Xstring .

    Hi Gurus ,
    How can I extract the data from a XSTRING  .
    I have to get the data which is filled in the survey form the data is getting saved in form of xstring .
    Someone told me that there is a standard FM for that . but I am not able to find .
    Please reply with the FM in case some one knows about it .
    Thanks in advance .

    The following code works as of 7.0 (in any SAP system):
    FORM XSTRING_TO_STRING USING input TYPE xstring CHANGING output TYPE string.
    TYPES : BEGIN OF ty_struc,
              line TYPE c LENGTH 100,
            END OF ty_struc.
    DATA lt_char TYPE TABLE OF ty_struc.
    DATA length TYPE i.
    length = xstrlen( input ) / cl_abap_char_utilities=>charsize.
    CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
      EXPORTING
        buffer                = input
      tables
        binary_tab            = lt_char.
    CONCATENATE LINES OF lt_char INTO output RESPECTING BLANKS.
    output = output(length).
    ENDFORM.
    Edited by: Sandra Rossi on Mar 30, 2010 12:24 AM

Maybe you are looking for

  • Can one assign a numerical value to a variable?

    Hi All, Good afternoon, I am currently working on a form that has strings as values in 2 different listboxes, and depending on what is selected a message pops up. Here is the script I wrote, but it does not seem to work right var a=aKlaclistbox.raWva

  • How to set the default zoom of browser to lowervalue(say 50% of present zoom) through prefs.js?

    Hi, I want to reduce the browser zoom level to a lower value so that i could see the whole of webpage through prefs.js as its for a test automation. I just wanted to see whole page on the browser. Can any help me with what this can be achieved?

  • Connecting to MS SQL 2005 via JDBC Driver

    I have an application in which I use Java to abstract database elements as objects and handle most of the server-side processing. This is done by creating a Java object via CreateObject(). The Java then connects to a MS SQL 2005 database using the JD

  • Where do I enter in a serial number for photoshop cs6?

    On installation i clicked on trial because i couldnt find my serial number and then when i found my serial number i opened photoshop. Well now i cant figure out where i go to enter in my serial number so that its no longer doing a trial. Any help wou

  • Web Services Managed API

    Hey, I'm trying to expose some Exchange stuff through my .NET web site. It's not working because I want to use the logged in users credentials but this fails. If I hard code a username and password all is well. My setup is: Client > IIS 7.5 Server >