How to store all database values in to a single textarea in swing

I am trying to show my database values in to a single textarea but i cannot able to show to that textarea.. pls someone help..

I am not shure what you are exactly meaning but you can use the setText(String text) method of JTextArea.
Several values could be seperated with a "\n" character.
import javax.swing.*;
public class ImplodeTrial {
  public static void main(String[] args) {
      String[] databaseValues={"Apple", "Banana", "Orange"};
      String temp=implode(databaseValues, "\n");
      JTextArea t=new JTextArea();
       t.setText(temp);     
      JFrame j=new JFrame();
       j.getContentPane().add(t);
       j.pack();
       j.setVisible(true);
   public static String implode(String[] ary, String delim) {
         String out = "";
         for(int i=0; i<ary.length; i++) {
             if(i!=0) { out += delim; }
             out += ary;
     return out;

Similar Messages

  • How to get all the values in one column of a JTable

    How to get all the values in one column of a JTable as a Collection of String.
    I don;t want to write a for loop to say getValueAt(row, 1) eg for 2nd column.

    I don;t want to write a for loop to say getValueAt(row, 1) eg for 2nd column. You could always write a custom TableModel that stores the data in the format you want it. It would probably be about 50 lines of code. Or you could write a loop in 3 lines of code. I'll let you decide which approach you want to take.

  • How to get all the values from the dropdown menu

    How to get all the values from the dropdown menu
    I need to be able to extract all values from the dropdown menu; I know how to get all those values as a string, but I need to be able to access each item; (the value in a dropdown menu will change dynamically)
    How do I get number of item is selection dropdown?
    How do I extract a ?name? for each value, one by one?
    How do I change a selection by referring to particular index of the item in a dropdown menu?
    Here is the Path to dropdown menu that I'm trying to access (form contains number of similar dropdowns)
    RSWApp.om.GetElementByPath "window(index=0).form(id=""aspnetForm"" | action=""advancedsearch.aspx"" | index=0).formelement[SELECT](name=""ctl00$MainContent$hardwareBrand"" | id=""ctl00_MainContent_hardwareBrand"" | index=16)", element
    Message was edited by: testtest

    The findElement method allows various attributes to be used to search. Take the following two examples for the element below:
    <Select Name=ProdType ID=testProd>
    </Select>
    I can find the element based on its name or any other attribute, I just need to specify what I am looking for. To find it by name I would do the following:
    Set x = RSWApp.om.FindElement("ProdType","SELECT","Name")
    If I want to search by id I could do the following:
    Set x = RSWApp.om.FindElement("testProd","SELECT","ID")
    Usually you will use whatever is available. Since the select element has no name or ID on the Empirix home page, I used the onChange attribute. You can use any attribute as long as you specify which one you are using (last argument in these examples)
    You can use the FindElement to grab links, text boxes, etc.
    The next example grabs from a link on a page
    Home
    Set x = RSWApp.om.FindElement("Home","A","innerText")
    I hope this helps clear it up.

  • How to get all the values of a variable with F4 with checkboxes to select

    Dear Experts,
    After Executing a query by giving let 3 values(Out of 10 Values) to a variable.
    To give 2 more input values to the same variable(i.e.,total I wanted to give 5 inputs this time ),after refreshing the query,for that variable if I click F4, I am seeing the historical values(i.e.,3) and remaining 7 values also But with out any Check Boxes besides them to select the 2 inputs.
    In the same F4 Screen, If I click all values(an Icon at The bottom),then also Im seeing but no check Box.
    I hve tried by deleting the Delete Personalization also,but no use.
    Please tell me How to get all the values with F4 with check boxes to select ,whatever I want??
    Thanks in advance

    Take a look at the InfoObject and go to the Business Explorer tab. If the 'Query Def. Filter Value Selection' is set to 'Only Values in InfoProvider', you're only going to get the values in F4 that exist in the InfoProvider, not everything in the Master Data. This would need to be changed to the value of 'Values in Master Data Table' if you want it to show everything possible when F4 is chosen.
    Likewise, you're going to need to look at the query and go to the Advanced tab for the InfoObject. Make sure that the radio button for 'Values in Master Data Table' is selected. If not, then you should change that selection.

  • Parameters - Not Filling in when using Append all database values

    Hello, I am using CR 2013 and trying to create a parameter which would be a list of organization names from a MySQL Database.  I am able to see the tables and field names no problem but when I click Append all database values I get the circle and nothing appears.   It should be noted I can see a list of values in the "Select Expert" for that same table and field.
    I am running a Windows 7 machine.
    Please let me know if you have any suggestions or solutions.
    Thanks,
    Peter LaMont

    are you using win 7 sp1 or higher as per the supported platforms. you probably are but have to ask.
    i would recommend trying to create a new report off of the same db and try to use a dcp again. if that doesn't work, can you create a dcp (using a new report) off of a different database type...e.g. ms access?
    is anyone else in your environment having the same issue?
    if none of the above work it's most likely an install issue and you may wish to try an update of cr finding the latest sp here..

  • How to group all the reports and execute like single application ?

    Hi,
    I am trying to develop some reports in Crystal Reports XIR2 , here i have Design and Preview options that is for every report i should see , how to group all the reports and execute like single application?
    any option is there to run the report
    i mean is it possible to have a home page from there have links to each report and when i click on the link corresponding report should be shown , if it is possible , How?
    Regards,
    kathyaini

    You will want to look into Crystal Reports Server, it does exactly what you describe and more:
    http://www.businessobjects.com/product/catalog/crystalreports_server/
    Download a trial of CR Server here:
    http://www.businessobjects.com/product/freetrials.asp

  • How to store internal table value in single variable

    hi gurus,
    i have 3 value in int table , so want to store the value of int table into single variable of type string.
    how it is possible

    hmmm, your requirement is kinda weird and you could have given us a bit more info, but well lets start.
    Why is your requirement weird?
    Well an internal table kinda is a variable itself, or rather a set of variables which together make up for a line type of your table.
    So you have a value you already have in a variable and now want to store it in anotherone? Seems weird.
    What type is your internal table?
    Do you have those three values in one record or in  three records which only hold one value each?
    Which of your values do you want to store in another variable?
    Anyway, make a F1 on the "READ TABLE" statement, this should definiteley help you.
    The "LOOP AT WHERE" statement could as well help if there should occur probrlem using READ TABLE.
    /edit DAMn i was posting this while you gave us more info.
    So still the question stays if you got your three values in one record or in three records.
    DATA: lv_variabl_containing_all      type char100.
    loop at itab into wa.
      concatenate lv_variabl_containing_all wa-value into lv_variabl_containing_all seperated by space.
    endloop.
    after the loop you now got all your values in lv_variabl_containing_all.
    That is for the case you got three records.
    other case would be
    Read table itab into wa index 1.
    concatenate wa-value1 wa-value2 wa-value3 into lv_variabl_containing_all.
    Edited by: Florian Kemmer on Apr 16, 2010 12:59 PM

  • How to get all the values in the Select-option.

    Hi,
    I got the select-option field so_week, for eg. If I give 200923 to 200926 (year and week)  in the selection screen and then I need to pass this value (200923) to the FM 'ZWEEK_GET_FIRST_DAY' to get the first day of the week.
    My question is how can i get all the values from the select option, (i.e) i need to get 200923, 200924,200925, 200926.
    Regards,
    Anbu.

    Hello,
    I will prefer Max's solution. But just for the sake of this req.
    i need to get 200923, 200924,200925, 200926
    i am proposing my soln:
    DATA: V_WEEK TYPE RSCALWEEK.
    SELECT-OPTIONS: S_WEEK FOR V_WEEK NO-EXTENSION OBLIGATORY.
    AT SELECTION-SCREEN.
      DATA:
      V_COUNT TYPE I,
      V_ADD   TYPE I,
      RT_WEEK TYPE RANGE OF RSCALWEEK,
      RS_WEEK LIKE LINE OF RT_WEEK.
      V_COUNT = ( S_WEEK-HIGH - S_WEEK-LOW ) + 1.
      DO V_COUNT TIMES.
        RS_WEEK-SIGN = 'I'.
        RS_WEEK-OPTION = 'EQ'.
        RS_WEEK-LOW = S_WEEK-LOW + V_ADD.
        APPEND RS_WEEK TO RT_WEEK. "RT_WEEK--> Will contain the week values
        CLEAR RS_WEEK.
        V_ADD = V_ADD + 1.
      ENDDO.
    @Max: I was stupid enough not to think of your solution. Need to leave office
    Cheers,
    Suhas

  • How to get all checked values from a chaeck box

    Hello
    In my app i have a checkbox called P10_CID with static lov like
    STATIC2:one;1,two;2,three;3,four;4,six;6
    my question is when i check more than one option
    i can not get that value.
    How is it possible to see all the values of the check box that are checked ?
    Regards
    Aris

    Hi Aris,
    Do you have to have checkboxes? Can you use a multiselect list instead?
    If you can, then the following excerpt from the user guide may help you:
    Using HTMLDB_UTIL.STRING_TO_TABLE to Convert Selected Values
    Suppose you had a report on the EMP and DEPT tables that is limited by the
    departments selected from a Department multiple select list. First, you create the
    multiple select item, P1_DEPTNO, using the following query:
    SELECT dname, deptno
    FROM dept
    Second, you return only those employees within the selected departments as follows:
    SELECT ename, job, sal, comm, dname
    FROM emp e, dept d
    WHERE d.deptno = e.deptno
    AND instr(':'||:P1_DEPTNO||':',':'||e.deptno||':') > 0
    Regards
    Andy

  • How to get all the values from a HashMap? thanks

    hi
    can anyone tell me how to get all the keys and their values contained in a HashMap? thanks

    thanks to u all for ur response, i gues if i need to get both keys and values, i need to use keySet() to get a set of keys first and then using each key to get value. is there any other faster way to get both of them (key and value)? thanks again

  • How to store the Arraylist value in variables ?

    Hi
    Here i use arraylist and i like to store all the arraylist in different variables Please tell the way .
    ArrayList list = new ArrayList();
    list.add("A");
    list.add("B");
    list.add("C");
    list.add("D");
    String a=""
    String b="";
    String c=""
    String d="";How to get and store the array list into the string variables
    Thanks & Regards
    Merlina
    Message was edited by:
    MerlinRosina

    Hai
    Thanks to your reply
    I already try this way but it throw the error "incompatible types"
    Do know any other way to store the object of arraylist into variables

  • How to capture all the values(occurrence) using Extraction Rules(correlation) in VSTS web test?

    Hi,
      I am using VSTS 2010 for performance testing and have a question about Extraction Rules functionality.  Requirement below.
    Example :
    Server Response
    <a>1</a>
    <a>2</a>
     <a>3</a>
    <a>...</a>
    we need to capture all the values with same left and right boundary. Along with the number of occurrence from the response. We need pass a random value in the
    index where the index value will be between 0 - count of values with same left and right boundary.
    How to find out the count of values with same left and right boundary.

    Thanks for Adrian's help.
    Hi PChav,
    Based on your issue, I think that the Adrian's suggestion is useful for you, so I suggest you could refer the Adrian's suggestion to check your issue.
    In addition, I suggest you could also try the rogeorge's suggestion to create a custom extraction rule to do this.
    Reference:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/ccff9f7a-d5bc-45d5-80eb-c83f9fc0e103/how-to-capture-all-the-valuesoccurrence-using-extraction-rulescorrelation-in-web-test?forum=vstswebtest
    Hope it help you!
    Best Regards,
    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.

  • HT4910 how to store all iphoto pics 80gB

    How do I store all my photos in iphoto to icloud?  Approx 80 GB.

    iCloud is not a storage medium, use DropBox or Sugarsync.

  • How to get all the values of the SDO_ORDINATE_ARRAY of a Oriented Point

    Hi,
    I'm trying to get the values of a Geometry wich is an Oriented Point. To that, i'm using SDO_UTIL.GETVERTICES, but this utility only obtains the point X,Y, it doesn't obtain the values of the orientation vector.
    The Geometry is this:
    MDSYS.SDO_GEOMETRY(
         2001,8307,NULL,
         MDSYS.SDO_ELEM_INFO_ARRAY(1,1,1,3,1,0),
         MDSYS.SDO_ORDINATE_ARRAY(-75.586088632813272,6.1794352615514194,0.57278169530235967,-0.81970795380217887,0)
    The query is this:
    SELECT c.ipid, c.nombre, t.X, t.Y, t.Z, t.W
    FROM Hidrantes c,
    TABLE(SDO_UTIL.GETVERTICES(c.geometria)) t
    where c.ipid = 4691117
    ORDER BY c.ipid, t.id;
    Result:
    4691117          -75,5860886328133     6,17943526155142          (null) (null)
    As you can see, it only obtains the X,Y values but not the values of the orientation vector, how can I get the values?.
    Thanks in advance

    Tobonale,
    Sql-Only approaches:
    *[1] Return Oridinate Array*
    Append .SDO_ORDINATES to your geometry object or column name:
    SELECT MDSYS.SDO_GEOMETRY(
         2001,8307,NULL,
         MDSYS.SDO_ELEM_INFO_ARRAY(1,1,1,3,1,0),
         MDSYS.SDO_ORDINATE_ARRAY(-75.586088632813272,6.1794352615514194,0.57278169530235967,-0.81970795380217887,0)
    ).SDO_ORDINATES
    FROM dualResult:
    SDO_ORDINATE_ARRAY(-75.586089, 6.17943526, .572781695, -.81970795, 0)*[2] Return Flattened Oradinate Array*
    SELECT * FROM
    TABLE (
         MDSYS.SDO_GEOMETRY(
         2001,8307,NULL,
         MDSYS.SDO_ELEM_INFO_ARRAY(1,1,1,3,1,0),
         MDSYS.SDO_ORDINATE_ARRAY(-75.586088632813272,6.1794352615514194,0.57278169530235967,-0.81970795380217887,0)).SDO_ORDINATES
    )Result:
      -75.586089
      6.17943526
      .572781695
      -.81970795
               0Regards,
    Noel

  • How do find all database slog size and mdf file size ?

    hi experts,
    could you share query to find all databases log file size and mdf file (includes ndf files ) and total db size ? in MB and GB
    I have a task to kae the dbs size  around 300 dbs
    ========               ============     =============        = ===        =====
    DB_Name    Log_file_size           mdf_file_size         Total_db_size           MB              
    GB
    =========              ===========               ============       ============     
    Thanks,
    Vijay

    Use this ViJay
    set nocount on
    Declare @Counter int
    Declare @Sql nvarchar(1000)
    Declare @DB varchar(100)
    Declare @Status varchar(25)
    Declare @CaptureDate datetime
    Set @Status = ''
    Set @Counter = 1
    Set @CaptureDate = getdate()
    Create Table #Size
    SizeId int identity,
    Name varchar(100),
    Size int,
    FileName varchar(1000),
    FileSizeMB numeric(14,4),
    UsedSpaceMB numeric(14,4),
    UnusedSpaceMB numeric(14,4)
    Create Table #DB
    Dbid int identity,
    Name varchar(100)
    Create Table #Status
    (status sql_Variant)
    Insert Into #DB
    Select Name
    From Sys.Databases
    While @Counter <=(Select Max(dbid) From #Db)
    Begin
    Set @DB =
    Select Name
    From #Db
    Where @Counter = DbId
    Set @Sql = 'SELECT DATABASEPROPERTYEX('''+@DB+''', ''Status'')'
    Insert Into #Status
    Exec (@sql)
    Set @Status = (Select convert(varchar(25),status) From #Status)
    If (@Status)= 'ONLINE'
    Begin
    Set @Sql =
    'Use ['+@DB+']
    Insert Into #Size
    Select '''+@DB+''',size, FileName ,
    convert(numeric(10,2),round(size/128.,2)),
    convert(numeric(10,2),round(fileproperty( name,''SpaceUsed'')/128.,2)),
    convert(numeric(10,2),round((size-fileproperty( name,''SpaceUsed''))/128.,2))
    From sysfiles'
    Exec (@Sql)
    End
    Else
    Begin
    Set @SQL =
    'Insert Into #Size (Name, FileName)
    select '''+@DB+''','+''''+@Status+''''
    Exec(@SQL)
    End
    Delete From #Status
    Set @Counter = @Counter +1
    Continue
    End
    Select Name, Size, FileName, FileSizeMB, UsedSpaceMB, UnUsedSpaceMB,right(rtrim(filename),3) as type, @CaptureDate as Capturedate
    From #Size
    drop table #db
    drop table #status
    drop table #size
    set nocount off
    Andre Porter

Maybe you are looking for

  • Display PCR in MSS

    Hi, Manager can create PCR in MSS. Once he fills details it goes to HR administrator. When HR is processing he will get action box like maintain pa30, pa40, view form,display form. pa30,pa40 is working fine, but when HR click the display or change fo

  • 2 WRT54G's - which one to be main router, which one to be repeater?

    I currently use a WRT54G v.3 router with one computer connected via wire and other devices accessing wifi.  Wifi signal is weak in various parts of the house and doesn't extend to the backyard.  I have another WRT54G router (ver 6) that I want to use

  • OS username & password

    Hi All, I have installed Oracle 10g(Version 10.1) in WindowsXP Environment, When I open Oracle Enterprise Manager, It is asking me for OS username and password below that Oracle username and password. My problem is, when I use PC Admin account, it sa

  • OPI in a SOA Architecture

    As we know, OPI works under simple http request/response model. In our proyect we need to focus the architecture to SOA. The question is. Is possible to enable the OPI interfaces under the SOA model (Web Services interchange under WSDL) in a SRM 4.0

  • Query in javascript

    Hi All, Im new to javascript and there is a requirement to do a date validation. I need to validate the date entered in a textbox which is in a format DDMMYYYY. please can you provide me the javascript code for this? thanks, mehul j