Hashtable or Vector to create Jtree ?Data from dtatbase.

I want build JTree in JApplet .
The JApplet is connecting to a database .
As soon as data change ,JTree change.
1.How can use hashtable or Vector to create Jtree ?
the Hashtable's Data or Vector's Data from Database.
2.How Japplet connect to a database and get data?

1-How can use hashtable or Vector to create Jtree ?
read JTree constrcutors in which u can use Vector for creating JTree like new JTree(myVector);
and in this myVector u can store your own objects and override toString() method of that object (stored in Vector), but as my practice its not good.
2.How Japplet connect to a database and get data?
You have to make signed applet for connecting your applet with database , and sorry to say but ita a real pain in your -------------

Similar Messages

  • Creating table data from multiple tables

    I want to be able to create a extract file  of the data in the BKPF and BSEG tables. I need to create one line that contains a combination of fields from each table. I am thinking that I have to select the data that I need from the BKPF table into a work table and select the data that I need from the BSEG using the document number field from the BKPF as part of the selection into another work table. after I get the two work tables, I am going to have to read the BKPF table and move the fileds that I want to a third table and then read every entry in the bseg work table that matches the document number and move those field to the third work table. after that is completed, I will a one table that has data from both tables. is this the correct way to handle this. if there is a easier way to perform this operation, could someone please let me know
    thanks in advance for the help.

    Hi Timothy,
    this would suffice.
    data: itab like bkpf occurs 0 with header line.
    data: itab1 like bseg occurs o with header line.
      SELECT * FROM BKPF INTO TABLE itab
                   WHERE BUKRS EQ P_BUKRS AND
                         BELNR IN S_BELNR AND
                         GJAHR IN S_GJAHR.
      SELECT * FROM BSEG INTO TABLE ITAB1
              FOR ALL ENTRIES IN ITAB
                        WHERE BUKRS eq ITAB-BUKRS
                        AND BELNR eq ITAB-BELNR
                        AND GJAHR eq ITAB-GJAHR.
    Regards,
    Vivek

  • Creating SQL Date from DD/MM/YYYY request parameters

    G'day,
    I have question regarding creating SQL Date so that it can inserted into MySQL database. In my JSP screen I have two drop downs boxes (One for day and one for month) and a textbox for year.
    In my servlet I want to make a SQL date object so that I can insert it into the database. Right now what I do is create GregorianCalendar object by passing year, month and day integers. Then I create java.util.Date object using GregorianCalendar's getTime method. Finally I create SQL Date object by using java.util.Date's getTime method.
    Iam having problems using this method. When the date gets inserted in the database the month is one more then it should be. (e.g instead of date as being 20/10/1973 it will be 20/11/1973).
    What is a better way to create SQL Date object?
    btw, Iam using PreparedStatement's setDate method that is why I want to create SQL Date object.
    Thanks for your help!

    Another way is to use the SimpleDateFormat class to convert that String to a Date object, and then convert that to SQL date the same way you already do. That has the advantage that you don't have to put in all that logic you already have (right?) to check that the month is between 1 and 12, and that the day is between 1 and whatever depending on the month...

  • Creating list- data from child data source not appearing in output

    I am trying to create a list of leads created between a date range for customers in a specific state. My audience is Persons. When I run the list, it does not return any values. However, I noticed that the date fields are not in the output. How do I get the date fields (from data source LEADS) into the output for my list? It seems to only be giving me output for the Parent data source of PERSONS.

    Map the Date Fields of the Leads data source to the ams_list_entries and check the box display in list entries.
    HTH

  • Creating Master Data from a transactional text source

    hi experts, my internal bw expert is still out and I need help again.
    We have a table in bw whose values we are going to push into a DSO so that we can create some reporting on it.  However, some of the characteristics on this table exist only as text (for example, end_user).  In order to make the reporting meaningful I need to
    1) Put the unique values into an infoobject.
    2) Create a routine that when I load the transactional values from the table to perform an abap lookup on the master data to find the right "key" value.
    Can anyone point me to a guide that can help me out with these tasks?

    I will first note that best practices are to not put descriptions into DSO's.   That said, this is how you can do it.
    Things to change... you'll want to go against the Text table instead of the attribute table which can be found on the Master Data tab of the InfoObject.  Obviously change the name of the fields and variables....
    GLOBAL Section of Start Routine / Transformation
        TYPES : BEGIN OF typ_compcode,
                      comp_code TYPE /bi0/pcomp_code-comp_code,
                      country   TYPE /bi0/pcomp_code-country,
               END OF typ_compcode.
        DATA :
               lt_compcode  TYPE HASHED TABLE OF typ_compcode WITH UNIQUE KEY comp_code,
               lwa_compcode TYPE typ_compcode.
    START ROUTINE
          SELECT  COMP_CODE
              COUNTRY
          FROM /BI0/PCOMP_CODE INTO TABLE lt_compcode
         FOR ALL ENTRIES IN SOURCE_PACKAGE
          WHERE COMP_CODE      = SOURCE_PACKAGE-COMP_CODE
    AND language = 'EN' if language dependant and  date if time dependant.
    Transformation Rule
    READ TABLE LT_COMPCODE INTO LWA_COMPCODE
                  WITH TABLE KEY COMP_CODE = SOURCE_FIELD-COMP_CODE.
    RESULT = LWA_COMPCODE-country.

  • Creating connectivity data from spatial data

    Hi,
    I have some spatial data, of which I will try to describe the relevant aspects:
    - A LineSegment table, which contains information on cables, including Area ID (approx 4 million rows)
    - A Location table, which contains a LineSegmentID (one-to-one), and a Geometry (spatial) column (approx 4 million rows).
    What I need to do is create a new table, containing conceptual "nodes", containing the following columns:
    - NodeID (number)
    - LineSegmentID (number)
    - LineSegmentEnd (1 or 2)
    So I need to work out, for each cable, which other cables it connects to, by comparing its endpoints with the endpoints of other cables in the same area. An area contains up to 464 cables. There are a total of 160 thousand areas.
    I am trying to work out the most efficient way of achieving this, ideally by performing a batch job that will take less than half an hour. Oracle is relatively new to me, but I am guessing the correct approach would be to use a series of intermediate (staging) tables, as I believe nested cursors would be way too slow (I have performed a simple test to confirm this).
    I guess I will need to extract, into a temp table, the start point and end point of each cable using SDO_LRS.GEOM_SEGMENT_START_PT and SDO_LRS.GEOM_SEGMENT_END_PT, along with area ID. Then join the table with itself and use SDO_GEOM.SDO_DISTANCE to work out which points are close to each other (e.g. less than one metre). However I am struggling to outline a step by step process.
    Does anyone have any thoughts which may help?
    (Oracle 11g)
    Thanks

    As requested Karthick. Please get back to me with any questions...
    create table line_location (lineid number,
    geometry sdo_geometry);
    create table line (id number, areaid number);
    -- one cable in area 1, 2 in area 4, etc.
    insert into line values (1, 1);
    insert into line values (2, 4);
    insert into line values (3, 4);
    insert into line values (4, 3);
    insert into line values (5, 3);
    insert into line values (6, 3);
    insert into line values (7, 2);
    insert into line values (8, 2);
    insert into line values (9, 2);
    insert into line values (10, 2);
    -- in reality the lines aren't necessarily straight and simple like these...
    insert into line_location values (1, MDSYS.SDO_GEOMETRY(2002,3785,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1),MDSYS.SDO_ORDINATE_ARRAY(10,1,10,4))); -- area 1
    insert into line_location values (2, MDSYS.SDO_GEOMETRY(2002,3785,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1),MDSYS.SDO_ORDINATE_ARRAY(3,9,5,9))); -- area 4
    insert into line_location values (3, MDSYS.SDO_GEOMETRY(2002,3785,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1),MDSYS.SDO_ORDINATE_ARRAY(5,9,5,10))); -- area 4
    insert into line_location values (4, MDSYS.SDO_GEOMETRY(2002,3785,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1),MDSYS.SDO_ORDINATE_ARRAY(1,1,2,1))); -- area 3
    insert into line_location values (5, MDSYS.SDO_GEOMETRY(2002,3785,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1),MDSYS.SDO_ORDINATE_ARRAY(2,3,2,1))); -- area 3
    insert into line_location values (6, MDSYS.SDO_GEOMETRY(2002,3785,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1),MDSYS.SDO_ORDINATE_ARRAY(2,3,3,3))); -- area 3
    insert into line_location values (7, MDSYS.SDO_GEOMETRY(2002,3785,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1),MDSYS.SDO_ORDINATE_ARRAY(5,3,5,4))); -- area 2
    insert into line_location values (8, MDSYS.SDO_GEOMETRY(2002,3785,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1),MDSYS.SDO_ORDINATE_ARRAY(4,4,5,4))); -- area 2
    insert into line_location values (9, MDSYS.SDO_GEOMETRY(2002,3785,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1),MDSYS.SDO_ORDINATE_ARRAY(5,9,6,4))); -- area 2
    insert into line_location values (10, MDSYS.SDO_GEOMETRY(2002,3785,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1),MDSYS.SDO_ORDINATE_ARRAY(5,7,5,9))); -- area 2
    create table node_line (node_id number,
    line_id number,
    endpoint_id number, -- 1 for startpoint, 2 for endpoint,
    area_id number
    -- expected output here. if two lines are less than 0.5 from each other, then they should share a node.
    insert into node_line values (1, 1, 1, 1); -- isolated cable in area 1, start point node
    insert into node_line values (2, 1, 2, 1); -- isolated cable in area 1, end point node
    insert into node_line values (3, 2, 1, 4); -- area 4, cable 2, start point node
    insert into node_line values (4, 2, 2, 4); -- area 4, cable 2, end point node
    insert into node_line values (4, 3, 1, 4); -- cable 2's end point node = cable 3's start point node, etc
    insert into node_line values (5, 3, 2, 4);
    insert into node_line values (6, 4, 1, 3); -- node at (1,1)
    insert into node_line values (7, 4, 2, 3); -- node at (2,1)
    insert into node_line values (8, 5, 1, 3); -- node at (2,3)
    insert into node_line values (7, 5, 2, 3); -- node at (2,1)
    insert into node_line values (8, 6, 1, 3); -- node at (2,3)
    insert into node_line values (9, 6, 2, 3); -- node at (3,3)
    insert into node_line values (10, 7, 1, 2); -- node at (5,3)
    insert into node_line values (11, 7, 2, 2); -- node at (5,4)
    insert into node_line values (12, 7, 1, 2); -- node at (4,4)
    insert into node_line values (11, 7, 2, 2); -- node at (5,4)
    insert into node_line values (13, 7, 1, 2); -- node at (5,9)
    insert into node_line values (14, 7, 2, 2); -- node at (6,4)
    insert into node_line values (15, 7, 1, 2); -- node at (5,7)
    insert into node_line values (13, 7, 2, 2); -- node at (5,9)

  • Creating XMP data from HTML page

    I have a very large number of images that are linked from websites in the form:
    <a href="images/filename.jpg">Image caption.</a>
    I would like to be able to use a script to batch process my files that will collect the text between the
    <a ....> and
    </a> tags, then insert that text into the jpg specified in the hyperlink as an XMP description.
    Suggestions?

    Andrew,<br /><br />1. If you want to append these data to the existent one, you've to read the XMP of the file.<br /><br />2. You've to add or modify the Dublin Core Description field <dc:description><br /><br />For example:<br /><rdf:Description rdf:about='uuid:d659be9a-21d7-11d9-9b6a-c1fd593acb83'<br />  xmlns:dc='http://purl.org/dc/elements/1.1/'><br /> <dc:format>image/jpeg</dc:format><br /> <dc:description><br />  <rdf:Alt><br />   <rdf:li xml:lang='x-default'>Image Caption</rdf:li><br />  </rdf:Alt><br /> </dc:description><br /></rdf:Description><br /><br />3. You've to replace the app1 block on the JPG with the new XMP<br /><br />Regards,<br /><br />Juan Pablo

  • Internationalized Object data from database

    Hi...
    I like to know which concepts you use in web application in case you need dynamic object data internationalized. For static web pages I can use ResourceBoundles to get the data but I'm still searching for the ideal way to do this with Object data.
    Let�s say you have a Product object which has a name and description in many different languages.
    Preferably I like to do something like this
    <c:out value="${product.name}"/>
    to display the users preferred (session) language, and for the special case to force a language I might use something like this
    <c:out value="${product.name}" locale="en_US"/>
    Now my big question is how should I implement something like this. Should the product.getName() method include the logic to determine the users session to call something like product.getName(Locale)? Or should I implement a custom tag to handle cases like this?
    What is your preferred way of doing this?
    Thanks,
    Gregor

    How can use hashtable or Vector to create Jtree ?
    the Hashtable's Data or Vector's Data from Database.

  • How to derive date from given month, year and day?

    Hi all,
    I have a doubt in date function. I need to create a date from the given month, year and day. How can i do it?

    consider this example
    REPORT zconvertdate001 .
    TYPES : BEGIN OF tt_date_in,
            day(2),
            sep1,
            month(3),
            sep2,
            year(4),
            END OF tt_date_in.
    DATA : wa_date_in TYPE tt_date_in VALUE '07-Jul-2006'.
    TYPES : BEGIN OF tt_date_out,
            day(2),
            month(2),
            year(4),
            END OF tt_date_out.
    DATA : wa_date_out TYPE tt_date_out.
    TRANSLATE wa_date_in-month TO UPPER CASE.
    SELECT SINGLE mnr
    INTO wa_date_out-month
    FROM t247
    WHERE spras EQ sy-langu
    AND   ktx EQ wa_date_in-month.
    CONCATENATE wa_date_in-year wa_date_out-month wa_date_in-day
           INTO wa_date_out.
    WRITE : / ' Date in:', wa_date_in,
            / 'Date out:', wa_date_out.

  • Preserving old Created On dates during SharePOint Online migration

    We are currently migrating files from our on-premise fileshare to SharePoint Online. We wish to carry as much file meta data from the fileshare into SharePoint Online, but when we drag&drop a file from the fileshare to our Documents
    library in in SharePoint we lose the original Created On data stored on the fileshare i.e. SharePoint site column 'Created' is populated with the date the file is created on SharePoint and not the original date of the file.
    Could anyone advise on how we can carry the Created On date from the fileshare into SharePoint?

    I believe Office 365 supports only web templates, not site templates. There is a subtle difference between these two.
    http://geekswithblogs.net/erwinvanhunen/archive/2012/02/09/creating-a-site-collection-from-your-own-webtemplate-on-office.aspx
    You need to create a custom web template, import it as .wsp, upload to Solutions gallery of Office 365 site-collection and activate it it. Have your done this ??
    I don't think you get direct access to log files for troubleshooting correlation id issues. You may need to contact microsoft support.
    Please mark the replies as answers if they help or unmark if not.

  • Create Master Data

    Hello,
       I am starting a new BW-BPS project, I am a beginner in BPS, and I would like to know if there is a way to create master data from BPS, and if it is possible what are the steps to do so.
       Thanks for your help,
       Luz

    Me too learner on BPS....
    I understand from the documentation to maintain/create master data we have to use normal BW masterdata loading or Maintaince using RSA1. We can utilise those data in BPS ofcourse..
    regards,
    Hari
    Welcome to SDN Luz!!

  • Reading data from Hashtable in another file

    how do i read the data from Hashtable which is created in another file. The file which creates hashtable is continuously running , and i want to read the content of the hash table into another file. Both the file exist in same machine.
    Help needed.
    Ancitipated Thanks

    Then you mean "class" or "object", not "file". Yes, you see the details of these classes in the source code files, and the compiled classes are kept in files, but programmers don't think of the files, they think of the objects running in the JVM. By calling them "files" you're causing confusion.
    Anyway, multiple threads can access a hashtable, which is synchronized apparently. So that alone shouldn't be a problem. If you have one object adding to a hashtable while another is reading its contents via an iterator, that could cause ConcurrentModificationExceptions.

  • Want JTree e.g. of populating data from database.

    I want ur JTree example of populating data from database, can u plz give me that eg.?
    Awaiting 4 ur reply.

    Hi,
    AFAIK, there is no direct approach to populate a JTree directly from a resultset. However, JTree can use a DOM tree as its model by using the adapter pattern. The procedure to do this is well-documented in the SUN website and the link is provided below. The code to convert a resultset to XML is provided below:
    protected void resultSetToXML(OutputStream out,
    ResultSet rs,
    String stylesheet)
    throws IOException, ServletException {
    // Create reader and source objects
    SqlXMLReader sxreader = new SqlXMLReader();
    SqlInputSource sis = new SqlInputSource(rs);
    // Create SAX source and StreamResult for transform
    SAXSource source = new SAXSource(sxreader, sis);
    StreamResult result = new StreamResult(out);
    // Perform XSLT transform to get results. If "stylesheet"
    // is NULL, then use identity transform. Otherwise, parse
    // stylesheet and build transformer for it.
    try {
    // Create XSLT transformer
    TransformerFactory tf = TransformerFactory.newInstance();
    Transformer t;
    if (stylesheet == null) {
    t = tf.newTransformer();
    } else {
    // Read XSL stylesheet from app archive and wrap it as
    // a StreamSource. Then use it to construct a transformer.
    InputStream xslstream = _config.getServletContext().
    getResourceAsStream(stylesheet);
    StreamSource xslsource = new StreamSource(xslstream);
    t = tf.newTransformer(xslsource);
    // Do transform
    t.transform(source, result);
    } catch (TransformerException tx) {
    throw new ServletException(tx);
    The classes SQLXMLReader and other classes used in this example are available in the following java packages.
    import java.sql.*;
    import javax.sql.DataSource;
    import javax.xml.parsers.*;
    import javax.xml.transform.*;
    import javax.xml.transform.sax.*;
    import javax.xml.transform.stream.*;
    import org.w3c.dom.*;
    import org.xml.sax.*;
    import org.xml.sax.helpers.AttributesImpl;
    The following is the link that explains how to load a JTree from DOM.
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXPDOM6.html
    Cheers,
    vidyut

  • How to create a report to bring all data from two different Info providers

    Hi All,
    I have a peculier problem while creating a report. I have two custom info providers one DSO and another Cube. There are only two common fields between these two Info providers . I need to create a report such that the report displays all the values from DSO but user can have the selection option on one of the fields in the Cube.
    Here is an example
    DSO Contents:
    DocNum-     DocItem-     DocText-     Amount-      Quantity
    10000----     10----            ABC----          100----           10
    10001----     20----     DSN----     200----     10
    10005----     20----     DSN----     200----     10
    Z1003----     10----     CAN----     500----     1
    Cube Contents
    DocNum-     DocItem-     Date-----          InvoiceAmt
    10000----     10----     1/10/2009----         50
    10001----     20----      2/20/2009----        100
    10005----     20----      2/25/2009----        100
    The report needs to be displayed as shown below when the user selects value for date from 1/10/2009 to 2/20/2009
    DocNum-     DocItem-     DocText-     Amount-      Quantity
    10000----     10----     ABC----     100----     10
    10001----     20----     DSN----     200----     10
    I hope this was clear for you to understand. I would really appricate if any one can answers about how to resolve this problem. I cannot add the date filed to DSO and I also have Doc Num and Item as the user selection fields in the report.
    Thank you all in advance and i would really appreciate for your suggestions.
    Regards
    Chinna
    Edited by: chinna2479 on Mar 3, 2009 7:38 PM
    Edited by: chinna2479 on Mar 3, 2009 7:39 PM

    Hi chinna,
    Two possible options, I can think of now, but both of them may be a compromise with performance.
    1. create an infoset and then a query on top of it, provided we have a one to one relation in both the targets. That is, the combination of doc and item number is not duplicate in either cube or ODS.
    2. Create a master data object of doc and item number and have date as an attribute. Load that from cube data and make date as navigational attr.
    Use this navgntal attr for selection in your report.
    Let us know, if you require any further info.
    Naveen.A

  • How to create a data load file from Excel !!!

    Hi All,
    I'm new to HFM and would like to load data into an HFM application. As I have an Excel file with all the data. When I'm directly loading the data it throws an error saying "No section has been specified to determine if this is data, description or line item detail". How can I convert this excel file into proper format (.dat) file understandable by HFM ?

    There are several ways to get this data into HFM.
    1) FDM - best option if you have it
    2) Webforms/Data Grids
    3) HsSetValue formulas in Excel
    4) DAT file loads
    5) JVs, etc
    If you wish to use DAT files created via Excel, you will likely want to use Excel VBA macros to create your DAT file to load. We do this on occasion for special projects and it works quite well. What you can do is set up an Excel file with your data inputs to look however you want, then link your POV members and amounts to another tab (we commonly call this the Export tab and it is set up in an HFM-friendly format).
    Create a macro to write a DAT file to a specified location using data from the Export tab. The DAT file will need to be formatted as below. For a specific sample, you can extract data from your HFM app and see the format.
    !Data
    Scenario;Year;Period;View;Entity;Value;Account;ICP;Custom1;Custom2;Custom3;Custom4;Amount
    Scenario;Year;Period;View;Entity;Value;Account;ICP;Custom1;Custom2;Custom3;Custom4;Amount
    Scenario;Year;Period;View;Entity;Value;Account;ICP;Custom1;Custom2;Custom3;Custom4;Amount
    Scenario;Year;Period;View;Entity;Value;Account;ICP;Custom1;Custom2;Custom3;Custom4;Amount
    Scenario;Year;Period;View;Entity;Value;Account;ICP;Custom1;Custom2;Custom3;Custom4;Amount
    Brush up on Replace, Merge, or Accumulate load options in the HFM Admin and User Guides, then upload your new DAT file.

Maybe you are looking for

  • Inplace Upgrade - 2008 R2 to 2012 R2 (with DataProtection Manager installed)

    Hello all, I have a simple question. I have a main file server, that is running on Server 2012 R2 operating system with Deduplication feature switched On, on the main share disk. This file server is supposed to be backed up by Data Protection Manager

  • Two copies of PS CC?

    When I export an image from LR5 to Photoshop CC it indicates the program has moved and literally opens another copy of PS, effectively giving me two copies of PS. How do I go back to just the good ole fashion single copy? Thanks

  • URL for local file?

    URL url= Room.class.getResource("images/door.jpg");This works. URL url= Room.class.getResource("file:/home/cs02rm0/folder/src/images/door.jpg");This doesn't work - java.lang.NullPointerException although if I put "file:/home/cs02rm0/folder/src/images

  • How does search feature work?

    Upper-right corner of any finder window has a "magnifying glass" search feature. Have never been able to get this to produce any useful results, nor can I find a pattern or any sort to the results it produces. Typed "epson" and nearly 100 results com

  • Can you define "single quote" character as a constant

    Hello all, I want to do something like this: CONSTANTS: q type c value ' .   " << thats a single quote character DATA: final_string type string,           VAL1(12) type c,           VAL2(12) type c. concatenate q val1 '-' val2 q into final_string. .