Help!!!!!!! Extract data from a database to put it in a combobox

hello
i have a combobox in wtich a want to put the reseult of the query(select name from departement)
do so have an idea please

I'm not an expert but may this could guide you...
JComboBox jcb = new JComboBox();
try {
            Statement stmt = dbcon.createStatement();
            String query = "SELECT name FROM clients ORDER BY name ";
            ResultSet rs = stmt.executeQuery(query);
            while (rs.next()) {
                jcb.addItem(rs.getString("name"));
        } catch (SQLException sqle) {
            System.out.println(sqle.getMessage());
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }I don't remember if you need a Model to work with a JComboBox, but if it's true you will need to make the same operations but working with the model...
Hope this helps
<xl>

Similar Messages

  • How to extract data from oracle database directly in to bi7.0 (net weaver)

    how to extract data from oracle database directly in to bi7.0 (net weaver)? is it something do with EDI? can anybody explain me in detail?
    Thanks
    York

    You can use UDConnect to get from Oracle database in to BW
    <b>Data Transfer with UD Connect -</b>
    http://help.sap.com/saphelp_nw04/helpdata/en/78/ef1441a509064abee6ffd6f38278fd/content.htm
    <b>Prerequisites</b>
    You have installed the SAP WAS J2EE Engine with BI Java components.  You can find more information on this in the SAP BW installation guide on the SAP Service Marketplace at service.sap.com/instguides.
    Hope it Helps
    Chetan
    @CP..

  • How can extract data from foxpro database?who can help me?

    I use jdbc-odbc to connect to my database ,database is foxpro, in the database there is a table named "tlb", I can select the table the total roll nums,but when I select the data from the roll, I cannot get the data, this data type is memo type, I don't know how get this data!

    I remember question about a memo type in Access and maybe also SQLServer. Is this the same like in FoxPro?
    If, then you might get help by searching this forum for "memo".

  • Retrieve data from SQL database and put into a table

    Hi all, i encountered this error while trying to create a table in 1 of my panels:
    C:\Documents and Settings\L311c01\Desktop\FYPJ Java2\RFIDLogistics.java:25:{color:#ff0000} cannot find symbol
    symbol : class ResultSetTable
    {color}location: class jdbc_bible.part2.RFIDLogistics
    private static ResultSetTable model = new ResultSetTable();
    ^
    C:\Documents and Settings\L311c01\Desktop\FYPJ Java2\RFIDLogistics.java:25: {color:#ff0000}cannot find symbol
    symbol : class ResultSetTable
    {color}location: class jdbc_bible.part2.RFIDLogistics
    private static ResultSetTable model = new ResultSetTable();
    I understand that " cannot find symbol class ResultSetTable means that i need to import something which has this ResultSetTable. I suppose my imports are sufficient and i think the error is with the package that i included.
    This package was taken from an example in a book named java database programming bible, so i assumed it is reliable and i use it for my insert statement, which had a DataInserter.
    Could someone plz help me with this? Thanks alot in advance.
    Here are the codes:
    {color:#ff0000}package jdbc_bible.part2;{color}
    import java.sql.*;
    import javax.swing.*;
    import java.util.Vector;
    import javax.swing.table.AbstractTableModel;
    import java.awt.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import java.io.*;
    import java.util.*;
    import javax.swing.event.*;
    import java.awt.event.*;
    import javax.swing.border.*;
    import sun.jdbc.odbc.JdbcOdbcDriver;
    public class RFIDLogistics extends JFrame{
    //Components
    // public SimpleClock clock;
    private static JTable jt;
    private static ResultSetTable model = new ResultSetTable();
    some codes
    {color:#ff0000}try
    {{color}
    {color:#ff0000} DataInserter inserter = new DataInserter();
    String SQLCommand = "INSERT INTO " + flstr + " (Item_ID,Location_ID) VALUES ('"+Item_ID1+"','"+Location_ID1+"')";
    String SQLCommand2 = "UPDATE Location SET Item_ID = '"+Item_ID1+"' WHERE Location_ID = '"+Location_ID1+"'";
    inserter.execute(SQLCommand);
    inserter.execute(SQLCommand2);
    {color} JOptionPane.showMessageDialog(null, "Successful!");
    catch(ClassNotFoundException f)
    f.printStackTrace();
    catch(SQLException f)
    f.printStackTrace();
    some codes
    public JPanel rightPanel() {
    JPanel rightPanel = new JPanel();
    rightPanel.setLayout(new BoxLayout(rightPanel, BoxLayout.Y_AXIS));
    //Forklift title Panel
    JPanel panel6 = new JPanel();
    panel6.setBorder(new TitledBorder(""));
    panel6.setPreferredSize(new Dimension(192,33));
    panel6.add(forkliftDetails);
    //Forklift 1 Panel
    {color:#ff0000} JPanel panel7 = new JPanel();
    panel7.setBorder(new TitledBorder("Forklift 1"));
    panel7.setPreferredSize(new Dimension(192,120));{color}
    {color:#ff0000} String query = "SELECT * FROM Forklift1";
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:RFID Logistics");
    PreparedStatement pstmt = con.prepareStatement(query);
    ResultSet rs= pstmt.executeQuery();
    // display the data in jtable
    jt = new JTable();
    model.setResultSet(rs);
    jt.setModel(model);
    catch(ClassNotFoundException sqle){
    System.out.println(sqle);
    }catch(SQLException sqle){
    System.out.println(sqle);
    panel7.add(itemDetail1);
    itemDetail1TextField.setEditable(false);
    panel7.add(itemDetail1TextField);
    panel7.add(locationDetail1);
    locationDetail1TextField.setEditable(false);
    panel7.add(locationDetail1TextField);
    panel7.add(jt);
    {color}..
    //Main Method
    public static void main(String args[]) {
    RFIDLogistics app = new RFIDLogistics();
    app.setFrame();
    app.setResizable(false);
    app.setDefaultCloseOperation(EXIT_ON_CLOSE);
    app.setSize(1024,676);
    app.setLocation(0,60);
    app.setVisible(true);
    If you would like to try if my table can extract, here are the sample codes, just change ur database name which is highlighted in green, and the table name in blue.
    Codes:
    import java.sql.*;
    import javax.swing.*;
    import java.util.Vector;
    import javax.swing.table.AbstractTableModel;
    import java.awt.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import java.io.*;
    import java.util.*;
    import javax.swing.event.*;
    import java.awt.event.*;
    import javax.swing.border.*;
    import sun.jdbc.odbc.JdbcOdbcDriver;
    public class sample1{
    private static JFrame frm;
    private static JTable jt;
    private static ResultSetTable model = new ResultSetTable();
    public static void main(String args[]){
    String query = "SELECT * FROM {color:#00ccff}Forklift1{color}";
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:{color:#00ff00}RFID Logistics{color}");
    PreparedStatement pstmt = con.prepareStatement(query);
    ResultSet rs= pstmt.executeQuery();
    // display the data in jtable
    jt = new JTable();
    model.setResultSet(rs);
    jt.setModel(model);
    frm = new JFrame("Sample");
    frm.setSize(400,400);
    frm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frm.add(jt);
    frm.setVisible(true);
    }catch(ClassNotFoundException sqle){
    System.out.println(sqle);
    }catch(SQLException sqle){
    System.out.println(sqle);
    Could someone plz help me with this? Thanks alot in advance.

    public JTable populateTable()
      String[] colNames = new String[] {"ID","NAME","SURNAME"};
      return new JTable(getSQLData(), colNames);
    public Object[][] getSQLData()
      stmt = conn.createStatement();
      ResultSet rs = stmt.executeQuery("SELECT [ID], [NAME], [SURNAME] FROM [USERS]");
      Object[][[] out = new Object[rs.getFetchSize()][3];//Not sure on getFetchSize but it should work
      int i = 0;
      while(rs.next())
        out[0] = rs.getInt(1);
    out[i][1] = rs.getString(2);
    out[i++][2] = rs.getString(3);
    return out;
    The above code will create a JTable with the data retrieved from the DB                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Help imigrating data from 9i database to 10g express edition

    hi all ,
    i am trying to import a *.dmp file from 9i to 10g express edition
    then problem is that i keep getting during import is
    imp-11119
    imp-11113
    ora-12899
    the data being imported is not english , it appears that there is a problem
    with importing the data
    can someone please help me plz

    i am sorry the errors are
    imp-00019
    imp-00003
    ora-12899
    i am using database 10g express universal edition
    in 9i
    select * from nls_database_parameters;
    PARAMETER VALUE
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_NUMERIC_CHARACTERS .,
    NLS_CHARACTERSET AR8MSWIN1256
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE AMERICAN
    NLS_SORT BINARY
    NLS_TIME_FORMAT HH.MI.SSXFF AM
    PARAMETER VALUE
    NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY $
    NLS_COMP BINARY
    NLS_LENGTH_SEMANTICS BYTE
    NLS_NCHAR_CONV_EXCP FALSE
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_RDBMS_VERSION 9.0.1.1.1
    but in 10g express universal edition
    select * from nls_database_parameters;
    PARAMETER VALUE
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_NUMERIC_CHARACTERS .,
    NLS_CHARACTERSET AL32UTF8
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE AMERICAN
    NLS_SORT BINARY
    NLS_TIME_FORMAT HH.MI.SSXFF AM
    PARAMETER VALUE
    NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY $
    NLS_COMP BINARY
    NLS_LENGTH_SEMANTICS BYTE
    NLS_NCHAR_CONV_EXCP FALSE
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_RDBMS_VERSION 10.2.0.1.0

  • Extract data from Oracle Database and store it into a CSV file format

    Hello.
    I'm trying to export a table from an Oracle Database into CSV file format with any Oracle adaptor and store it into a HDFS system.
    How could I do it?
    Thanks in advance!

    Xavi wrote:
    HI Charles. Could I use.. Oracle Data Integrator Application Adapter for Hadoop? For this purpose?
    Thanks in advancePerhaps. I have to confess that I am not familiar enough with ODI to know if that is within its capabilities.
    You might see if there is a forum for ODI and post your question to that.
    Charles Lamb

  • Extracting date from oracle/other databases exactly to java

    Hello Friends,
    Iam creating a simple program which extracts data from any database and stores it in an XML file and also it can extract data from an XML file and updates the database.
    My program is just getting the tablename as an input and from that it builds the query (select * from tablename). Through ResultSet, Iam extracting date fields with getDate() method of ResultSet, which is yeilding converted dates [In oracle if date is 23-DEC-1980, Im getting it as 1980-12-23 in java]. Even getString() method of ResultSet doesn't work.
    I want my program to work with any database engine, which may have their own date formats. Kindly can anyone suggest me a way to extract date from any database exactly as it is to java.
    NOTE:: I can't use to_char(datefield) type commands in SQLQUERY as the only input to my program is tablename and my query is, select * from tablename.
    Regards,
    Ch.Praveen.

    HI Friends,
    Thanks for your fast replies. My program is extracting data from a database and generating an XML file for it, which is as follows.
    <?xml version="1.0" encoding="UTF-8"?>
    <table tableName="EMP">
    <row>
    <column columnName="EMPNO" columnType="NUMBER">7369</column>
    <column columnName="ENAME" columnType="VARCHAR2">'SMITH'</column>
    <column columnName="JOB" columnType="VARCHAR2">'CLERK'</column>
    <column columnName="MGR" columnType="NUMBER">7902</column>
    <column columnName="HIREDATE" columnType="DATE">'1980-12-17'</column>
    <column columnName="SAL" columnType="NUMBER">800</column>
    <column columnName="COMM" columnType="NUMBER" />
    <column columnName="DEPTNO" columnType="NUMBER">20</column>
    </row>
    <row>
    <column columnName="EMPNO" columnType="NUMBER">7499</column>
    <column columnName="ENAME" columnType="VARCHAR2">'ALLEN'</column>
    <column columnName="JOB" columnType="VARCHAR2">'SALESMAN'</column>
    <column columnName="MGR" columnType="NUMBER">7698</column>
    <column columnName="HIREDATE" columnType="DATE">'1981-02-20'</column>
    <column columnName="SAL" columnType="NUMBER">1600</column>
    <column columnName="COMM" columnType="NUMBER">300</column>
    <column columnName="DEPTNO" columnType="NUMBER">30</column>
    </row>
    </table>
    Here you can observe that HIREDATE column is having date in different format than in oracle. We are getting an error while we are extracting data from an XML file and updating the database, as dateformats differ. Can anyone provide a solution, which extracts date from database to java exactly as per the dateformat in database.

  • Extract data from database to xml ?

    is there any API, classes or tools ready to extract data from oracle database and generate xml files, Instead to implement a DOM class and build little by little the xml file??
    thanks for every info in advance.

    Yes, download the Oracle XML Development Kit from Oracle's website and look at the documentation of the XML-SQL Utility.

  • Extract data from Java to Excel

    Apologies for my ignorance in this field but is it possible to extract data from a Java based application (stock charts and the like) directly into Excel? If so could someone please contact me and explain the process in very simple terms as i have no idea how Java works :o)
    Many thanks.
    Gilsey

    Actually I should qualify my "Yes" answer. It is possible for a Java application to output data to Excel (using Jakarta POI for example). Whether it is possible to persuade an existing Java application to do that depends on the application. If it has been programmed to do it, then yes. Or if it has an underlying database where it stores its data, and you have access to that database, it might be possible to extract data from the database into Excel. Otherwise the programming of the application would have to be changed.

  • Retriving data from oracle database

    hi all,
    i have connected to oracle database  and i want retrieve data from that database.can u please give the procedure how to retrieve data and how to load it into info cube

    Hi,
    You can use either DB connect or UD connect for extracting data from external database.
    DB Connect:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2f0fea94-0501-0010-829c-d6b5c2ae5e40
    UD Connect:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/58f4db47-0501-0010-a2bf-ff01b150fdff
    Also please search in SDN, you will find lot of threads related to this topic.
    regards,
    Pruthvi R

  • Is it possible to save / extract data from a MS SQL database 2008 using lookout 6.2?

    Is it possible to save / extract data from a MS SQL database 2008 using lookout 6.2?
      Now a days we are saving / extracting data in a excel spreadsheet, but we would like to do that using a database because it is better.

    You can use ODBC connection to work with SQL Server database.
    Use SQLExec object to execute the SQL statement. Here is a KB about the SQL statement.
    http://digital.ni.com/public.nsf/allkb/4ADEEA04CD24AE0B862565E20002A16F?OpenDocument
    To write data to spreadsheet is more straightforward because Lookout has built-in spreadsheet object. But you need to write SQL statement by yourself to interact with other database.
    To read the data back is the same way. Just use "select" SQL statement to query. You can use Datatable object to query.
    The "Data Source" can be "DSN = data source name;". The data source name is configured in Control Panel->Administrative Tools->Data Sources(ODBC).
    Ryan Shi
    National Instruments

  • How to extract data from essbase to oracle database incrementally?

    I have to extract data from essbase to an oracle database table incrementally using informatica , can anyone tell me how to do it or give me some tips. I have been thinking about it for a whole day but have no ideas.
    I cannot do the delete & insert method because this oracle database table is a interface table that has to deliver the data to Oracle ESB tables.
    Thanks in advance....

    Hi,
    Have you read through :-
    Oracle Data Integrator Adapter for Hyperion Essbase Getting Started - http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/odiess_getting_started.pdf
    Oracle Data Integrator Adapter for Hyperion Essbase User's Guide - http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/odiess_users.pdf
    If you have read them and are still have a problem at what stage are you having the issues?
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How to extract payload data from SOA database schema using Java

    I am trying to extract the payload data and output as XML text files using Java. Seems that is stored in SOA table XML_DOCUMENT. I am trying the following Java code to get started and it's not working as I would expect. I only get a few actual lines of output and, when I do, I only get the *<?xml version ... ?>* line.
    I appreciate any advice to extract the payload data from the database. Ultimately I will want to include the composite instance ID in the SQL but for now I'm just using the code shown here:
    OracleDataSource ods = new OracleDataSource();
    ods.setURL("soa_db_connection_string");
    ods.setUser("soa_db_user_id");
    ods.setPassword("soa_db_password");
    Connection conn = ods.getConnection();
    String sql = "select document from xml_document where rownum < 10";
    OraclePreparedStatement stmt = (OraclePreparedStatement)conn.prepareStatement(sql);
    DBBinXMLMetadataProvider dbrep = BinXMLMetadataProviderFactory.createDBMetadataProvider();
    dbrep.setConnectionPool(ods);
    dbrep.associateDataConnection(conn);
    OracleResultSet rset = (OracleResultSet)stmt.executeQuery();
    XMLDOMImplementation domimpl = new XMLDOMImplementation();
    BinXMLProcessor proc = BinXMLProcessorFactory.createProcessor(dbrep);
    while (rset.next()) {
         Blob blob = rset.getBlob("DOCUMENT");
         BinXMLStream inpbin = proc.createBinXMLStream(blob);
         BinXMLDecoder dec = inpbin.getDecoder();
         InfosetReader xmlreader = dec.getReader();
         XMLDocument doc = (XMLDocument)domimpl.createDocument(xmlreader);
         doc.print(System.out);
    }

    I found a method using a slight variation of the code I originally posted. Essentially you remove the DBBinXMLMetadataProvider dbrep portion. I believe, with this included, the XML being extracted is validated against the database (which is referenced as a "metadata provider"). Since the SOA schema doesn't seem to contain the information to validate the XML it returns as blank. If you don't include the dbrep portion then the XML is extracted as desired.
    OracleDataSource ods = new OracleDataSource();
    ods.setURL("soa_db_connection_string");
    ods.setUser("soa_db_user_id");
    ods.setPassword("soa_db_password");
    Connection conn = ods.getConnection();
    String sql = "select document from xml_document where rownum < 10";
    OraclePreparedStatement stmt = (OraclePreparedStatement)conn.prepareStatement(sql);
    OracleResultSet rset = (OracleResultSet)stmt.executeQuery();
    XMLDOMImplementation domimpl = new XMLDOMImplementation();
    BinXMLProcessor proc = BinXMLProcessorFactory.createProcessor();
    while (rset.next()) {
         BLOB blob = rset.getBLOB("DOCUMENT");
         BinXMLStream inpbin = proc.createBinXMLStream(blob);
         BinXMLDecoder dec = inpbin.getDecoder();
         InfosetReader xmlreader = dec.getReader();
         XMLDocument doc = (XMLDocument)domimpl.createDocument(xmlreader);
         doc.print(System.out);
    }

  • Extract data from database tables and download in pdf and csv

    extract data from database tables and download in pdf and csv
    hi how can i re-write my old form procedure in adf java. the procedure used to extract data from diffirent table and dowload the data in pdf and csv.am not downloading image, i what to extract data from diffirent tables in my database and download that data in pdf and csv. i would like to write this in java adf.i just what direction am not asking anyone to do my work this is my learning curve
    the form code is
    function merge_header3 return varchar2 is
    begin
         return '~FACILITY DESCRIPTION~ACCOUNT NO~BRANCH CODE~BANK REF NO.~P/P/ AMOUNT~Postal Address 1~Postal Address 2~Box Postal Code~Dep. Date~Month~BANK NAME~BRANCH NAME~ACCOUNT TYPE~DESCRIPTION~OBJECTIVE DESCRIPTION';
    end;
    procedure download_file (i_pbat integer) is
      dir varchar2(80);
      file_name1 varchar2(80);
      file_name2 varchar2(80);
      appl_code varchar2(80);
      fil1 client_text_io.file_type;
      fil2 client_text_io.file_type;
      dat varchar2(1000);
      DATA VARCHAR2(1000);
      bvspro varchar2(100);
      ssch   varchar2(100);
      bvspro_total number(20,2);
      ssch_total   number(20,2);
      grand_total  number(20,2);
      cnt    integer;
      cursor pbat is
           select *
           from sms_payment_batches
           where id = i_pbat
      cursor pay  (pb_id integer) is
           select *
           from sms_payment_vw
           where pbat_id = pb_id
           order by subsidy ASC,programme,beneficiary_name
      cursor cgref (low varchar2) is
           select *
           from cg_ref_codes
           where rv_domain ='SMS'
           and rv_low_value = low
      success boolean;     
      begin  
           set_application_property(cursor_style,'busy');
           appl_code := sms_global.ref_code('SMS','APP_CODE','SMS',0);
        dir       := sms_global.ref_code('SMS','PAY_DIR','c:\sms\batch_payments',0);
             success := webutil_file.create_directory(dir);
         if webutil_file.file_is_directory(dir) then
             null;
    --         message ('directory exists');
        else
    --                  message ('create directory ');
             success := webutil_file.create_directory(dir);
    --         if success then        message ('directory exists');    end if;
        end if;     
        for c_pbat in pbat loop
             file_name1 := dir ||'\' || appl_code||c_pbat.batch_number||'-'||to_char(c_pbat.batch_dt,'yyyymmdd')||'pay.txt';
             file_name2 := dir ||'\' || appl_code||c_pbat.batch_number||'-'||to_char(c_pbat.batch_dt,'yyyymmdd')||'merge.txt';
    --message('create files ');
    --         fil1  := client_text_io.fopen (file_name1,'W');
    --         fil2  := client_text_io.fopen (file_name2,'W');
        fil1  := client_text_io.fopen (file_name1,'W','');
        fil2  := client_text_io.fopen (file_name2,'W','');
                   dat :=                       'FROM ACCOUNT NUMBER'
                                                                ||'~'||'FROM ACCOUNT DESCRIPTION'
                                                                ||'~'||'MY STATEMENT DESCRIPTION'
                                                                ||'~'||'BENEFICIARY ACCOUNT NUMBER'
                                                                ||'~'||'BENEFICIARY SUB ACCOUNT NUMBER'        
                                                                ||'~'||'BENEFICIARY BRANCH CODE'
                                                                ||'~'||'BENEFICIARY NAME'
                                                                ||'~'||'BENEFICIARY STATEMENT DESCRIPTION'
                                                                ||'~'||'AMOUNT';
             --     client_text_io.put_line(fil1,dat);
             bvspro:= null;
             ssch  := null;
             cnt := 0;     
             dat := '~'||lpad('~',16,'~');
             for c_pay in pay(c_pbat.id) loop
    --message('cpay loop ' || cnt);              
               if bvspro is null then
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(1,c_pay.programme,dat,'~');     
               client_text_io.put_line(fil2,dat);
               dat := utility.put_field(1,c_pay.subsidy,dat,'~');
               client_text_io.put_line(fil2,dat);
               dat := merge_header3;
                     client_text_io.put_line(fil2,dat);
                     bvspro := c_pay.programme;
                     ssch := c_pay.subsidy;
                     grand_total := 0;
                     bvspro_total := 0;
                     ssch_total := 0;
               end if;
               if bvspro <> c_pay.programme then
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(5,ssch_total,dat,'~');
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(5,bvspro_total,dat,'~');
               dat := utility.put_field(1,'Total:' || bvspro,dat,'~');
                     client_text_io.put_line(fil2,dat);
                     dat := lpad('~',16,'~');
               client_text_io.put_line(fil2,dat);
                     dat := utility.put_field(1,c_pay.programme,dat,'~');     
               client_text_io.put_line(fil2,dat);
                     bvspro := c_pay.programme;
               dat := utility.put_field(1,c_pay.subsidy,dat,'~');
               client_text_io.put_line(fil2,dat);
               dat := merge_header3;
                     client_text_io.put_line(fil2,dat);
                     bvspro := c_pay.programme;
                     ssch := c_pay.subsidy;
                     bvspro_total := 0;
                     ssch_total := 0;
                     cnt :=0;
             end if;                           
               if ssch <> c_pay.subsidy then
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(5,ssch_total,dat,'~');
                     dat := lpad('~',16,'~');
               client_text_io.put_line(fil2,dat);
               dat := utility.put_field(1,c_pay.subsidy,dat,'~');
               client_text_io.put_line(fil2,dat);
               dat := merge_header3;
                     client_text_io.put_line(fil2,dat);
                     ssch := c_pay.subsidy;
                     ssch_total := 0;
                     cnt :=0;
             end if;                           
            bvspro_total := bvspro_total + c_pay.amount;
            ssch_total   := ssch_total   + c_pay.amount;              
                  grand_total  := grand_total  + c_pay.amount;              
            cnt := cnt +1;
    --message('bfore write file 2 ' );              
            client_text_io.put_line(fil2
                                   ,cnt
                            ||'~'|| c_pay.beneficiary_name
                                                                ||'~'||c_pay.BENEFICIARY_ACCOUNT_NUMBER ||''            
                                                                ||'~'||c_pay.BRANCH_CODE             ||''           
                                                                ||'~'|| c_pay.BENEFICIARY_STATEMENT_DESC            
                                                                ||'~'|| c_pay.AMOUNT                                
                            ||'~'|| c_pay.address_line1
                            ||'~'|| c_pay.address_line2
                                                    ||'~'|| c_pay.postal_code
                                                    ||'~'|| TO_CHAR(c_pay.deposit_date,'DD-Mon-YYYY')
                                                    ||'~'|| c_pay.month
                                                    ||'~'|| c_pay.bank
                                                    ||'~'|| c_pay.bank_branch
                                                    ||'~'|| c_pay.account_type
                                                    ||'~'|| c_pay.subsidy
                                                    ||'~'|| c_pay.programme)
                  DATA :=                                  c_pay.FROM_ACCOUNT_NUMBER                   
                                                                ||'~'||c_pay.FROM_ACCOUNT_DESCR                    
                                                                ||'~'||c_pay.MY_STATEMENT_DESCR                    
                                                                ||'~'||c_pay.BENEFICIARY_ACCOUNT_NUMBER
                                                                ||'~'
                                                                ||'~'||c_pay.BRANCH_CODE            
                                                                ||'~'||c_pay.BENEFICIARY_NAME                      
                                                                ||'~'||c_pay.BENEFICIARY_STATEMENT_DESC            
                                                                ||'~'||c_pay.AMOUNT;                                
            DATA := REPLACE(DATA, ',' , ' ' );
            DATA := REPLACE(DATA, '~' , ',' );
    --message (cnt ||' ' || data);       
    --message('bfore write file 1 ' );              
                  client_text_io.put_line(fil1, data);
             end loop;
    --message ('end of write');         
                 dat := lpad('~',16,'~');
                 dat := utility.put_field(6,ssch_total,dat,'~');
                 dat := lpad('~',16,'~');
           dat := utility.put_field(1,'Total:' || bvspro,dat,'~');
                 dat := utility.put_field(5,bvspro_total,dat,'~');
              client_text_io.put_line(fil2,dat);
              dat := lpad('~',16,'~');
           client_text_io.put_line(fil2,dat);
           dat := utility.put_field(1,'Grand Total:' ,dat,'~');
                 dat := utility.put_field(5,grand_total,dat,'~');
              client_text_io.put_line(fil2,dat);
             -- close file
    for i in 1..50 loop  
           if substr(i,-1) = 0 then
                 message ('flush ' || i);
           end if;                 
                  client_text_io.put_line(fil1, lpad(' ',2000));
                  client_text_io.put_line(fil2, lpad(' ',2000));
                  client_text_io.put_line(fil1, lpad(' ',2000));
                  client_text_io.put_line(fil2, lpad(' ',2000));
    end loop;
             client_text_io.fclose(fil1);
             client_text_io.fclose(fil2);
        end loop;
       set_application_property(cursor_style,'default');
        exception
             when others then
                  message(sqlcode ||' ' ||sqlerrm);
       end download_file;    i try this but this code onlydownload image not data from database tables
        public void downloadImage(FacesContext facesContext, OutputStream outputStream)
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
            // get an ADF attributevalue from the ADF page definitions
            AttributeBinding attr = (AttributeBinding) bindings.getControlBinding("DocumentImage");
            if (attr == null)
                return;
            // the value is a BlobDomain data type
            BlobDomain blob = (BlobDomain) attr.getInputValue();
            try
            {   // copy the data from the BlobDomain to the output stream
                IOUtils.copy(blob.getInputStream(), outputStream);
                // cloase the blob to release the recources
                blob.closeInputStream();
                // flush the output stream
                outputStream.flush();
            catch (IOException e)
                // handle errors
                e.printStackTrace();
                FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, e.getMessage(), "");
                FacesContext.getCurrentInstance().addMessage(null, msg);
            }

    You should ask your forum in the ADF-forum.

  • How to extract data from database to XSLT?

    I want to generate a report by XSLT, but the data is extracted from the database. I will use Access/SQL server for my database. Can i write SQL in XSLT to extract data from database? Have any sample code or reference website to show how it work?
    THX

    for example: "SELECT code, name FROM TABLE FOR XML RAW"
    String xml = null;
    if(rs.next()){
      xml = rs.getString(1);
    }You will get xml string something like this:
    <row empID="1234"/><row empID="1235"/>
    You can construct a DOM using this xml data and operate on it.
    However you may explore more on resulting xml format.
    A different SQL Query (rather than using XML RAW) may give output in a more desired format.

Maybe you are looking for

  • Sorting in 6i and 10g reports

    Hello All, I am running 6i and 10g reports against a 10g database. I ran one of the 6i report and it generated a report in one sorting ordear and when i ran the same report on 10g ,it generated the report in ddifferent order. Both the reports r run a

  • Find relevant message in SXMB_MONI for a specific IDoc

    Hi, I have an IDoc sent from XI to ECC. I need to look at the payload in XI. I was told there was a way to find out which entry in SXMB_MONI is for the IDoc, but cannot remember. Does anybody know how to do it.

  • Anual VAT Declaration Portugal - Anexo L

    Hello, I'm customizing the system for the anual VAT declaration for Portugal, and I have a doubt about the ANEXO_L_M, because the in the tcode DMEE for the Tree Type UMS3 i don't have format tree PT_ANEXO_L_M. I saw the note 1177103 where one of the

  • Super wide slide size to optimize screen resolution to Barco Encore

    Trying to wrap my mind around choosing the right slide size for a 5.6666:1 aspect slide to display on two 4:3 and one middle 3:1 screens continuously. The last show, we were limited to a resolution to the Encore board of 1600x1200 so with a slide so

  • Static Files with same name. How does apex determine which files to serve?

    Hello, I'm using apex 4.2.1.00.08 and I cannot figure out how apex manages the static files and cannot find any help in the docs (other that some high level UI description). The application is serving some file and I cannot find which one it is in an