Create JTree using data from DataBase

Hi all,
I have GUI with JTree, and i have data in database with ParentID, ChiledID fileds,
i want to crate tree structure from using data in database.
can you people tell me how can i proceed, I will get a data as List of Vectors from DB.
Thanks
Daya

i got the solution,
what i did i having object class extended DefaultMutableTreeNode and i have list of objects class refrence and i know which is parent and a child so just add the child refrence to parent refrence which stored in list.
Thanks
daya

Similar Messages

  • Have a combobox pre-filled using data from database

    What would be a recommended method to have a combobox
    pre-filled using data from database?

    You can load an Array with the data returned from your
    database and bind to that array as the dataProvider for the
    comboBox.
    [Bindable]
    private var myArrayDP:Array = new Array();
    //Load the array with your returned data.
    <mx:ComboBox dataProvider="{this.myArrayDP}">
    </mx:ComboBox>
    Using an ArrayCollection however is often better if you want
    changes to the dataProvider to automatically reflect in the
    ComboBox.

  • 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 -------------

  • Creating XML file using data from database table

    I have to create an xml file using the data from multiple table. The problem That i am facing is the data is huge it is in millions so I was wondering that is there any efective way of creating such an xml file.
    It would be great if you can suggest some approach to achieve my requirement.
    Thanks,
    -Vinod

    An example from the forum: Re: How to generate xml file from database table
    Edited by: Marco Gralike on Oct 18, 2012 9:41 PM

  • Constructing Jtree with data from Database

    Hi
    I am new to JTree and I need some help. My problem goes like this. I have a table in the data base which has data like Folder_Nr, Folder_Name, Folder_Prev_Nr, Folder_Typ_Nr, Folder_Access.
    If the Folder_Nr is 1 and folder_prev_nr =0, then it is a root folder and if folder no is 3 and folder_prev_no is 1 then it is a sub folder of the Folder_Nr 1. and so on is the data. I need to present all these folders in a JTree and be able to dynamically add and delete folders.
    It will be of great help if anyone can provide me with some lead or some source code.
    Thanking u in advance
    BalaaP

    Yes,using LiveCycle you could accomplish this easily.Once you have your invoice form ready based on predefined XSD, you can easily update the form data by fetching the values from database using JDBC operation.Also you could email this updated form using Email service.
    Thanks,
    Wasil

  • Create XML using data from Oracle

    Other than using OracleXMLQuery, how do I create an XML file from the data from a table in Oracle?
    Rgds,
    Seetesh

    Vetsrini:
    Thanks for your response. I no longer can receive email at [email protected], because I am at a different company now. So please post directly to this forum so I can receive my messages.
    I would imagine that "look ahead" is a feature needed by many applications, since the heading of a document may depend on the data within. In my case, we have a Pack Slip that we want the bold heading title to change if the word "FAX" is inside the body of the document. Instead of saying "Pack Slip", it would say "Fax Pack Slip".
    Any hints would be greatly appreciated.
    Regards,
    Rich Locus

  • How to create JSON using data from websql

    Hi Experts,
                    am trying to make list in sapui5 and the data in the list should be populate from the database.....so far success but i want to make a json of database

    Ok, I got it.
    You have to store the data as a JSON object or get the data from WebSQL and convert to JSON before use it in your Model.
    You can check the links below.
    javascript - Inserting JSON data into Sqlite/webSQL database - Stack Overflow
    javascript - How can I get JSON fton WebSQL - Stack Overflow
    Hope it helps you.

  • Need to create 'Characteristics' using data from legacy system

    Hi All,
            I need to create the 'Characteristics' in SAP using the data from legacy application. The allowable values list defer between characteristics.
    1) which upload tool & method I can use?
    Thx,
    Gopi

    no problem, lsmw is fine to read from text files, you can define the path & format in step 'Specify Files'
    Message was edited by:
            Harris Veziris

  • Create pdf using data from another pdf

    Hi,
    I need to automate the following process.
    A user fills in a pdf form(on a website) and submits it. A notification is sent to the appropriate person of the submission. This person will add in more information in the same form and when finished, clicks a ‘Generate’ button  that will create 3 pdf’s with the same data as the initial pdf but with some more added text.
    Is it possible to achieve this using adobe forms?
    Help is much appreciated.
    Thanks!

    Hi,
    Say you have a report for retrieving Sales by Products for a company and showing up grand total of sales for all products too in the same report. So, how about a case where you would like to see each product's contribution to the whole sales numbers? For this, a new column could be something like
    Measures.Sales*1.0/SUM(Measures.Sales)
    Here Measures.Sales is the sales for each product and SUM(Measures.Sales) is nothing but the total sales ie grand total.
    Hope this helps.
    Thank you,
    Dhar

  • Create Query using data from 0IC_C03 to show stock balance

    Dear All,
    I have successfully setup 0IC_C03. I have loaded in the data in accordance with the documentation. I check the result and it seems the stock balance match with the data source.
    However, my question is how can I setup a formula in the query so I can look up stock balance based on the date I put in to run the query.
    For example, I loaded in the data on Oct 13, 2008. For material A,  I have a key figure called Quantity total stock which is the net of receipt and issue total stock is  10,000 LB as of Oct 13, 2008. 
    When I run the same query using the date as of Oct 31, 2005, the quantity total stock show  -10,000 LB.  The stock balance of material should be 0 LB on Oct 31, 2005.   I know I can't just simply create 2 key figures - one using the loading date (Oct 13, 2008)  and one using the input variable date to add up together since I will have trouble if I enter Oct 13, 2008 as the input variable day because it will zero out.
    Please advise. Thanks.

    Hi Brian,
    Thank you for your reply.  After I double check, the setting was wrong in the DTP of 2LIS_03_BX to feed the infocube 0IC_C03.  it wasn't set to initial Non-cumulative for non-cumlative value in the extraction mode. after I change that and re-ran the whole process, the current and past stock balances are correct.
    However. the problem happen again when I test delta update.  I loaded 2LIS_03_BF delta update first to 0IC_C03 and compress with no marker update was checked. after that, I loaded 2LIS_03_UM delta update and compress with no no marker update was checked.  For some reasons, the quantity total stock doesn't add up. it should be 9600 LB in total quantity stock but show 0 LB as of Oct 08. When I ran the query for Oct 06, the quantity total stock show -9600 LB.  do you know why? Thanks again.

  • I need help I want to analyze and create reports using data from my firefox history files .

    I am not quite sure where to post this. I had a program for analyzing my firefox history which no longer works due to the change in how firefox stores history data. I am not an sqlite user. Any help will be greatly appreciated.
    I downloaded the sqlite manager addon and it is now installed on my firefox browser. I have tried it out and can make some sense of it. I would like to know how to decode the time/date storage system.

    It uses Unix time, which is the number of seconds that have elapsed since January 1, 1970 00:00 UTC /GMT.
    http://en.wikipedia.org/wiki/Unix_time <br />
    Here is an online converter tool for Unix times. <br />
    http://www.esqsoft.com/javascript_examples/date-to-epoch.htm

  • 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

  • Help , How to get data from database using recordset with UI API

    I want to get a data from database
    when I want to create recordset i notice that UI API didn't has record set
    so I created recordset using DI API (SAPbobscom.recordset and SAPbobscom.company)
    ======================================================
    Dim oCompanyUI As SAPbouiCOM.Company <<UI API
    Dim oRecSet As New SAPbobsCOM.Recordset << DI API
    Dim oCompanyDI As New SAPbobsCOM.Company << DI API
    '=====================================================
    oCompanyDI.Connect
    Set oRecSet = oCompanyDI.GetBusinessObject(BoRecordset)
    oRecSet.DoQuery ("SELECT T0.CardCode, T0.CardName FROM OCRD T0")
    SBO_Application.MessageBox oRecSet.Fields.Item(1).Value
    ======================================================
    but I got an error it said "you are not connected to company"
    I'm really don't have an idea about how to get a data from using UI API (exp I want to get a date or costumer code)
    can someone help me please, I really need it
    Thanks

    you need a single sign on
            Dim oDICompany As SAPbobsCOM.Company
            Dim sCookie As String
            Dim sConnStr As String
            Dim ret As Integer
            oDICompany = New SAPbobsCOM.Company
            sCookie = oDICompany.GetContextCookie
            sConnStr = SBO_Application.Company.GetConnectionContext(sCookie)
            If oDICompany.Connected Then
                oDICompany.Disconnect()
            End If
            ret = oDICompany.SetSboLoginContext(sConnStr)
            If Not ret = 0 Then
                SBO_Application.MessageBox("set Login Context failed!")
                Exit Sub
            End If
            ret = oDICompany.Connect()
            If Not ret = 0 Then
                SBO_Application.MessageBox("Company Connect failed!")
            End If

  • Is there a way to retrieve data from database wihout using JDBC while using JPDK?

    Hi,
    I want to create a portlet using JPDK with extra render modes and edit/Edit defaults mode too. The detail and show renderer mode jsp's/servlets render data from database. Based on the personalized paramter, the data rendered in detail and show mode will be obtained from database.
    The articles in the PDK zip asks not to use JDBC for security vulnerability. Does that mean , I should not use JDBC to connect to db to get data. If not, what should I use ? How do I connect to database ? Is there any class which helps to connect to db without using JDBC ?
    thanks,
    Mainak

    I'm not sure what articles you are refering to, because there is no other way to access a database from a java program. Generally, security related docs tend to be a little paranoid (and so they should be), but you have to balance high security against getting the job done.
    Obviously, if using JDBC, you need to be careful about protecting your config files because they will contain connection information.

  • How to fetch data from Database using SUP MBOs

    I'm learning to develop blackberry apps using SUP.I am new to both blackberry api and SUP.
    I need to make a login page for a Student and then validate the username and password entered using data from a database.
    I need to check the database for the username and password entered. What should be my next step? How do i get this data from the database. Using findAll() method is not working . Do i need to connect to SCC or unwired server first. If yes , then someone please provide a sample code for it.

    Hi!, I see your code and I see that you have a fee errors, try to use this:
    import java.text.*;
    import java.sql.*;
    import java.util.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.OutputStream;
    * NOTE: You must put the try-catch and your sql code into the get method
    /** Servlet program to take fetchdata from database and display that on the broswer*/
    public class Fetchdata
        extends HttpServlet {
      String query = new String();
      String uid = "ashvini";
      String pwd = "******";
      public void doGet(HttpServletRequest request, HttpServletResponse response) throws
          ServletException, Exception {
        try {
          Connection con = null;
          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          String url = "jdbc:odbc:Testing";
          con = DriverManager.getConnection(url, uid, pwd);
          Statement s = con.createStatement();
          query = "select * from gowri.msllst1";
          ResultSet rs = s.executeQuery(query);
          response.setContentType("text/html");
          ServletOutputStream out = response.getOutputStream();
          out.println("<HTML>" + "<BODY BGCOLOR=\"#FDF5E6\">\n" +
                      "<H1 ALIGN=CENTER>" + title + "</H1>\n" +
                      "<table>" + " <th>ITEM Code</th>");
          while (rs.next()) {
            out.println("<tr><td>" + rs.getString(1).trim() + "</td></tr>");//I change </tr></td> for </td></tr>
          } //end of while
          out.println("</table></BODY></HTML>");
        catch (Exception e) {
          System.out.println(e);
      } //end of doGet method
    }I hope this help you :)

Maybe you are looking for