Walkthrough: Displaying Data from Oracle database in a Windows application.

This article is intended to illustrate one of the most common business scenarios such as displaying data from Oracle database on a form in a Windows application using DataSet objects and .NET Framework Data Provider for Oracle.
You can read more at http://www.c-sharpcorner.com/UploadFile/john_charles/WalkthroughDisplayingDataOracleWindowsapplication05242007142059PM/WalkthroughDisplayingDataOracleWindowsapplication.aspx
Enjoy my article.

hi,
this is the code :
public class TableBean {
Connection con ;
Statement ps;
ResultSet rs;
private List perInfoAll = new ArrayList();
public List getperInfoAll() {
int i = 0;
try
con = DriverManager.getConnection("url","root","root");
ps = con.createStatement();
rs = ps.executeQuery("select * from user");
while(rs.next()){
System.out.println(rs.getString(1));
perInfoAll.add(i,new perInfo(rs.getString(1),rs.getString(2),rs.getString(3)));
i++;
catch (Exception e)
System.out.println("Error Data : " + e.getMessage());
return perInfoAll;
public class perInfo {
String uname;
String firstName;
String lastName;
public perInfo(String firstName,String lastName,String uname) {
this.uname = uname;
this.firstName = firstName;
this.lastName = lastName;
public String getUname() {
return uname;
public String getFirstName() {
return firstName;
public String getLastName() {
return lastName;
ADF table code:
<af:table value="#{tableBean.perInfoAll}" var="row"
binding="#{backing_Display.table1}" id="table1">
<af:column sortable="false" headerText=""
align="start">
<af:outputText value="#{row.firstName"/>//---> Jdeveloper 11g doesn't allow me to use this.. it says firstName is an unknown property..
</af:column>
</af:table>
Please tell me is this the way to do it.. or is it a must to use the DataCollection from the data controls panel...
Thanks...

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 to I convert data from oracle database into excel sheet

    how to I convert data from oracle database into excel sheet.
    I need to import columns and there datas from oracle database to microsoft excel sheet.
    Please let me know the different ways for doing this.
    Thanks.

    asktom.oracle.com has an excellent article on writing a PL/SQL procedure that dumps data to an Excel spreadsheet-- search for 'Excel' and it'll come up.
    You can also use your favorite connection protocol (ODBC, OLE DB, etc) to connect from Excel to Oracle and pull the data out that way.
    Justin

  • How to send a mail automatically based on a date from ORACLE database

    Hi,
    I want to send a mail automatically based on a date from ORACLE database.
    Please help me.
    thanks
    --Sara                                                                                                                                                                                                                                   

    programs are available on net to send mail directly from oracle ie procedure s in oracle sending mails

  • To fetch data from Oracle Database

    Hi Gents,
    Any alternative option other than SQL to fetch data from Oracle DAtabase. ( My manager worked on Mainframes he is telling other than SQL there should be some options.. Gents pls guide if any options.......
    REgards
    Fento

    >
    Any alternative option other than SQL to fetch data from Oracle DAtabase. ( My manager worked on Mainframes he is telling other than SQL there should be some options.. Gents pls guide if any options.......
    >
    There is no other (supported) way to get data from Oracle Databases as SQL. No matter what third-party tool you use to access Oracle Databases, they all will use (embedded) SQL.
    In very rare cases, one must use tools to read from datafiles directly because the database got damaged and a proper recovery is impossible. That is an emergency solution and by no means a replacement for SQL access.
    In short: No :-)
    Kind regards
    Uwe
    http://uhesse.wordpress.com

  • FETCH DATA FROM ORACLE DATABASE USING Web Dynpro

    I want to fetch data from ORACLE database using Web Dynpro.How can I do this?

    1) Are you sure that you get no results? It sounds like you are having name resolution issues, which would imply that you should be getting an ORA-00942 error indicating that the table doesn't exist (or that you don't have access to the table). If you are not seeing this error, I would tend to suspect an overzealous exception handler.
    2) What database account owns the table? What database account is your ASP.Net application using to connect? Assuming these two accounts are different, your application would either have to
    - Explicitly prefix the table name with the schema name
    - Have a public or private synonym that maps the table name to the fully qualified identifier schema_name.table_name
    - Issue the command ALTER SESSION SET CURRENT_SCHEMA = <<schema name>> in each session, in which case all queries in the session would use the specified schema name as the default if no schema name is prefixed.
    Justin

  • Want to see on screen data from oracle database using php

    I am struggling on the problem of echoing data from Oracle database (9i) to the screen for viewing. For ex. the data has records from various cities. when a particular city is inputted as prompt, all the records for the that city from the table should appear through PHP. Can someone help me?

    Thank you very much for giving the link. I tried and it is working. Only, I am still struggling with trying to get many fields from the database on the screen for viewing. Ex. a prompt to ask which country and which month. If I give India and December it must give all the data pertaining to India for December. This AJAX was very useful, as it gave lot of tips, but my basic query to see the data thru PHP from my database is still unsolved. Any help??
    Jacob
    Thanks once again for the help.

  • Use an applet in a Jsp to display data from Oracle DB

    Hi everyone, I'm very new to java my question is:
    Is there a way to display an applet like a table within a Jsp to display data from a Oracle DB? The thing is that I would be able to show this applet only at the click of the submit button in my html form.
    Please help me any sample code are welcome
    Thank you in advance
    Fabry

    Hi,
    Why can't you use a Java Bean which takes the data from the database. Then call this bean from the JSP page using <jsp:useBean> tag.
    Ok,if you dont want a Java Bean and if you want to use an applet in a JSP file, you will have to use <jsp:plugin>tag. Here is an example
    <html><head><title> Demo Applet</title></head>
    <body bgcolor="rd">
    <% if (request.getParameter("SUBMIT") != null) {%>
    <jsp:plugin type="applet" code="DemoApplet.java" codebase="." name="Demo" height="400 with="300>
    <jsp:fallback> Plug in not supported by your browser</jsp:fallback>
    </jsp:plugin>
    </body></html>
    Hope this will help you.
    Rgds,
    Ravi Shankar

  • Problem Displaying data from oracle in JTable

    Please can any one help me? I have a problem displaying the data fetched from oracle database(ResultSet) in JTables. Can any one provide me with any possible way out(and any alternative).

    User,
    As suggested in the other post - Google/Books/find a mentor is the best option.

  • How to Display Data from Oracle E Business Suite tables in ADF

    Hi,
    I am new to ADF.
    I have a requirement to Create an ADF page for Search Results Screen.
    However the result data is from one of the Oracle E Business Suite Tables.
    ie I need to create a Screen where user will enter a Purchase Order Number and Click on Button.
    The Screen should show details from PO_HEADERS_ALL (from Oracle ERP Database Table) based on the entered PO Number.
    Is it possible to implement the same? Can some one guide me how to do it?
    Thanks,
    Kamath

    Hi,
    Is there a way where I can create a VO in ADF to which I can insert records dynamically from a source and the Source connects to E Business Suite tables and returns results ie BPEL etc.
    http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/bcadvvo.htm#sm0341
    Just replace the PLSQL example with your data source
    Can ADF invoke SOA which inturn connects to Oracle E Business Suite and fetches the data from Oracle tables and pass it back to ADF? Is it possible
    Yes. Just use a WS proxy client to access the SOA entry point (WSDL) and follow the link above
    Frank

  • 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

  • Problem reading data from oracle database 11g using OleDbDataReader

    Hi everyone I work with Visual Studio 2010 and C# programming language. I have a problem reading data from the oracle database. I created a WPF application with my main Window Xaml and class files and 1 more class called DataFiles. The thing I want is to read some data from the database on my grid in my WPF window. Problem is even though it connects to the database the grid is always empty. It isn't the connection string as I tested it and it connects to the database the problem seems to be in showing the LASTNAME (PREZIME in my native tongue) on the grid which is what it's supposed to do.
    Here is the code:
    Data Files Code
    using System;
    using System.Collections.ObjectModel;
    using System.Data.SqlClient;
    using System.Data.OleDb;
    namespace SQLKonekcija
        public class clsEmployee
            public string Prezime { get; set; }
        public class DataAccess
            OleDbConnection oleCon;
            OleDbCommand oleComd;
            public DataAccess()
                string connectionString = "provider=ORAOLEDB.ORACLE; data source=ORCL; password=****; user id=****;";
                oleCon = new OleDbConnection(connectionString);
            public ObservableCollection<clsEmployee> GetAllEmployee()
                ObservableCollection<clsEmployee> EmpCol = new ObservableCollection<clsEmployee>();
                oleComd = new OleDbCommand();
                oleComd.Connection = oleCon;
                oleComd.CommandText = "Select PREZIME from UPOSLENICI";
                oleCon.Open();
                OleDbDataReader Reader = oleComd.ExecuteReader();
                Reader.Read();
                while (Reader.Read())
                    EmpCol.Add(new clsEmployee()
                        Prezime = Reader["PREZIME"].ToString()
                oleCon.Close();
                return EmpCol;
            }And here is my main window.cs code
    public partial class MainWindow : Window
            clsEmployee objEmpToAdd;
            DataAccess objDs;
            public MainWindow()
                InitializeComponent();
            private void Window_Loaded(object sender, RoutedEventArgs e)
                objDs = new DataAccess();
                dgEmp.ItemsSource = objDs.GetAllEmployee();And the XAML
    <Window x:Class="SQLKonekcija.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded">
        <Grid>
            <DataGrid AutoGenerateColumns="False" Height="237"
                      HorizontalAlignment="Left" Margin="18,66,0,0" Name="dgEmp"
                      VerticalAlignment="Top" Width="466" ColumnWidth="*"
                       >
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding PREZIME}" Header="Prezime"></DataGridTextColumn>
                </DataGrid.Columns>
            </DataGrid>
            <TextBlock Height="42" HorizontalAlignment="Left" Margin="18,15,0,0" Name="textBlock1" Text="TEST CONNECTION" VerticalAlignment="Top" Width="462" TextAlignment="Center" FontSize="28" FontWeight="ExtraBold" />
        </Grid>
    </Window>
    The guys on the MSDN forums told me I should ask the question here so sorry if it's not your field.
    Hope u guys can help, thanks.

    I tried it, commented out the reader.read and have the following connection string
    string connectionString = "provider=ORAOLEDB.ORACLE; data source=ORCL; password=****; user id=****; OLEDB.NET=True"
    Unfortunately the result is the same.
    Edited by: Dino2dy on Nov 24, 2011 12:53 AM

  • Import data from oracle database table into csv file

    Hi
    I have to import data from a table into a csv file. Could anyone suggest the best method to do it? My application is JSP as frontend and have put business logic in servlet.
    Thanks in advance.

    FastReader from wisdomforce will help you quickly export data into csv file. http://www.wisdomforce.com
    fastreader can be called and executed as an external process ( Runtime.exec(..) ) to extract data from Oracle tables into flat file

  • Retrieving data from oracle database and displaying using servlets

    //DataRetrieving.class file
    import java.io.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class DataRetrieving extends HttpServlet{
    public void doGet(HttpServletRequest request, HttpServletResponse response)throws
    ServletException, IOException{ 
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    out.println("A program for connecting oracle database");
    try
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:ORCL", "scott","tiger");
    Statement stmt = con.createStatement();
    ResultSet r = stmt.executeQuery ("SELECT ename,job,sal,comm,deptno FROM emp");
    while ( r.next() )
         String bar = r.getString("ename");
         String bar1 = r.getString("job");
         float bar2 = r.getInt("sal");
         float bar3 = r.getInt("comm");
         int bar4 = r.getInt("deptno");
         //out.println(r.getString(0)+" "+r.getString("ename"));
         out.println("hi");
         out.println(bar1);
    r.close();
    stmt.close();
    con.close();
    catch (Exception e)
    out.println("ERROR : " + e);
    //web.xml file
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!--<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd"> -->
    <web-app>
    <servlet>
    <servlet-name>Hello</servlet-name>
    <servlet-class>DataRetrieving</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Hello</servlet-name>
    <url-pattern>/DataRetrieval</url-pattern>
    </servlet-mapping>
    </web-app>
    while running the servlet , i am unable to retrieve the data
    The error message i am getting is
    A program for connecting oracle database
    ERROR : java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
    after running the servlet.
    what could be the problem?

    import java.io.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class myserv extends HttpServlet
    public void doGet(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException
    res.setContentType("text/html");
    PrintWriter pw=res.getwriter();
    pw.println("Connecting data base");
         try
         Class.forName("oracle.jdbc.driver.OracleDriver");
         Connection con=Drivermanager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","scott","tiger");
         Stamtenet st=con.createStament();
         Resultset rs=con.executeQurey("select * from emp");
         while(rs.next())
         rs.getInt("empno")+" "+rs.getDouble("sal"));
         }catch(Exception e)
    }

  • How to display data from a database to a  JComboBox  JTextField

    Hello
    I was wondering I have a database called "PAYTYPE" and have a colums called
    EMPLOYEETYPE     PAYBASIC     PAYSUNDAY     PAYHOLIDAY     PAYPERIOD
    What i want to do is display the list of EMPLOYEETYPE in a combo box(Which i got this part working),
         try{
              ResultSet rs = db.getResult("Select * FROM PAYTYPE");
              while(rs.next())
                   payTypeField.addItem(rs.getString(2));
              }catch(SQLException e)
              }When an item is selected from the combo box then the information thats in PAYBASIC,PAYSUNDAY,PAYHOLIDAY, PAYPERIOD will be displayed in textfields
    this is the problem im trying to solve
    Any Ideas ??????

    What im trying to do is the following
    on my Gui i have 1 JComboBox and 3 JtextFields
    The Jcombo box is populated by the data base
    try{     
              ResultSet rs = db.getResult("Select * FROM EMPLOYEEPAYTYPE");
              while(rs.next())
                   payTypeField.addItem(rs.getString(2));
              }catch(SQLException e)
              }Now that i have the JComboBox filled I want the other 3 JTextField to be populated with the information that been selected by the JComboBox
    I under stand there needs to be a .addActionListener(this) to the JComboBox
                    payTypeField = new JComboBox();
                payTypeField.setBounds(130, 10,100,20);
                payTypeField.addActionListener(this);
                payTypeField.addItemListener(this);
                 c.add(payTypeField);I would just like the steps that i need to take in order to fill the JTextBoxes in pudoscode
    The information that i need will need to be pulled from the database - EMPLOYEEPAYTYPE
    Thanks
    Jon

Maybe you are looking for