Trying to populate a JTable

Hello
Im having some issues populating a JTable.
I know that one of the ways to populate it is using the constructor JTable(Object[][] rowData, Object[] columnNames)
All the exmples I�ve seen on the net initialize the arrays this way
private String[] columnNames = {"","First Name","Last Name","Email"};
private Object[][] rowData = {
{"Mary", "Campione","Snowboarding", new Boolean(false)},
{"Alison", "Huml","Rowing", new Boolean(true)},
{"Kathy", "Walrath","Knitting", new Boolean(false)} };
that works fine, the problem is that Im trying to display more that 8000 records from a Database
and I can�t initialize the data array that way so I created a loop that pupulates the array and here is where the issue starts
One of the Colums needs to be a checkbox, and I know that in order to display the check box I need to store a boolean value into the Object array (data)
however if I do the following i get an error message
Object data[][] = new Object[rows][cols];
data[row][col] = new Boolean(false);
with the above code I get an ArrayStoreException which I know what It means, whowever how come when I initialze the array the first way it works
and the second way doesn�t work ?
Can someone helps?
Thanks

Don't forget to use the [Code Formatting Tags|http://forum.java.sun.com/help.jspa?sec=formatting], so the posted code retains its original formatting.
the problem is that Im trying to display more that 8000 records from a DatabaseWell you shouldn't be using an array in this case because you don't know how many rows are in the database. You should be using Vectors. You can search the forum for my "Table From Database" (without the spaces) example posted in the forum.

Similar Messages

  • Please help-- need to populate a jtable at runtime

    Hello all,
    i have this problem:
    i have to populate a jtable at runtime.i take the data
    from different buttons and from a jlist.i will focus
    on the jlist here because the problem is elsewhere
    after i select the particular items from the list i put them in a 2d array. the problem is that this array
    might have null entries.for example, according to the
    list item selections, my array might look like this:
    data[0][0] = "somedata"
    data[0][1] = ""
    data[0][2] = "otherdata"
    and so on
    when i try to add row to the table it adds the
    data[0][1] as well (tablemodel.addRow(data[0]);)
    is there any way to make it not print the elements
    that have null values?
    the problem is that the number of rows and the number of columns of data is generated at runtime and it can be up to data[6][200] so if i only put data in say
    data[45] and data[i][195] i only want to print
    this values in the jtable's rows and not the whole
    data[i]
    i try to put the results of data[][] that are not null in a new array but it doesnt work.here is how i try to do this:
    for (int i=0;i<data[0].length;i++) {
    for (int b=0;b<data.length;b++) {
    while (data[b][i] != null)
    datanew=data;
    when i try to add row datanew[b] in the jtable i see the same result (some columns are empty)
    if i try to print data[b] i see something like "Ljava.jang.string:2@#435"
    but if i print data[b][i] for the i's that are not null then i see the right results.
    is there any way i can do it ?maybe exceptions handling? i dont know.
    any kind of help would be greatly appreciated.
    i am a begginer in java, i hope i dont sound ridiculous.
    thank you in advance

    thanks for your reply everybody
    well i have changed the algorithm a little and now it works. however, i have a similar problem right now
    as i said in the beggining the data will be selected both from a jlist and some buttons. now the list work.
    the list has items that relate to buttons.
    so now i have one more condition that will show only the
    results of the list that relate to the buttons.
    i have done this by using a boolean when each button is
    selected.
    the problem now is that i have an array that have null rows (instead of null columns that i had before)!!
    even though i can add them to the jtable normally since
    they are rows, i dont want to show empty rows.
    so i want to create a new array that will have as rows
    all the rows of the first array that contain data.
    Here is my algorithm that generates data according to jlist and buttons selection:
    Object[] selected_items = charList.getSelectedValues();
    for (int j=0;j<selected_items.length;j++)
    tablemodel.addColumn(selected_items[j]);
    for (int k=1;k<data[0].length;k++){
    if ( selected_items[j].equals(data[0][k]) ){
    for (int b=0;b<=data.length-2;b++){
    if (authors_boolean_array)
    data3[b][j]=data[b+1][k];
    else System.out.print("no author ");
    else System.out.print("no ");
    System.out.println("");
    doesnt matter how it works. the result is that it ends
    with a data3[b][j] array that can be up to data3[6][200]
    and might have empty rows
    so i want a new array say data4[][]
    for example i need to find a way to do something like this:
    data4[0][0] = data3[0][0];
    data4[0][1] = data3[0][1];
    data4[1][0] = data3[2][0];
    data4[1][1] = data3[2][1];
    i tried something like this: (count is the number of the selected buttons)
    for (int j=0;j<selected_items.length;j++){
    for (int b=0;b<=data.length-2;b++) {
    if (data3[b][j] != null) {
    for (int c=0;c<count;c++) {
    for (int d=0;d<selected_items.length;d++) {
    data4[c][d]=data3[b][d]; // (*)
    else System.out.println("data4 null");
    but it doesnt work because b isnt increased as need
    at (*) line
    well i know this is causing a hedaque so i wont be suprised if i dont receive any answer.however, since there are always some kind people arround i thought i could give it a try as it would save me precious time.
    thank you all for your time

  • How to Populate the JTable Object programatically with SQL Results

    I'm wondering if someone could help me on how to populate the JTable Object with SQL Results wherein the Row of tjhe JTable object is automatically adjusted depending on how many records you have queried.
    Thanks in advance and God bless! (",)
    * frmMain.java
    * Created on October 4, 2006, 6:15 AM
    package tds;
    import java.io.*;
    import java.awt.Toolkit;
    import javax.swing.JFrame;
    import javax.imageio.*;
    import javax.swing.JFrame;
    import java.sql.*;
    import javax.swing.table.DefaultTableModel;
    * @author Dexter.Carlit
    public class frmMain extends javax.swing.JFrame {
    private Connection connection = null;
    private DefaultTableModel model;
    /** Creates new form frmMain */
    public frmMain() {
    initComponents();
    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
    jSplitPane = new javax.swing.JSplitPane();
    jScrollPane1 = new javax.swing.JScrollPane();
    jPanel3 = new javax.swing.JPanel();
    jScrollPane2 = new javax.swing.JScrollPane();
    jTree1 = new javax.swing.JTree();
    jTabbedPane1 = new javax.swing.JTabbedPane();
    jPanel1 = new javax.swing.JPanel();
    jPanel4 = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    jTextField1 = new javax.swing.JTextField();
    jTextField2 = new javax.swing.JTextField();
    jLabel3 = new javax.swing.JLabel();
    jTextField3 = new javax.swing.JTextField();
    jLabel4 = new javax.swing.JLabel();
    jTextField4 = new javax.swing.JTextField();
    jPanel5 = new javax.swing.JPanel();
    jScrollPane3 = new javax.swing.JScrollPane();
    jGrid = new javax.swing.JTable();
    jButton1 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();
    jProgressBar1 = new javax.swing.JProgressBar();
    jPanel2 = new javax.swing.JPanel();
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
    addWindowListener(new java.awt.event.WindowAdapter() {
    public void windowOpened(java.awt.event.WindowEvent evt) {
    formWindowOpened(evt);
    getAccessibleContext().setAccessibleName("frmMain");
    jSplitPane.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
    jSplitPane.setDividerLocation(200);
    jSplitPane.setDividerSize(10);
    jScrollPane2.setViewportView(jTree1);
    org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout.setHorizontalGroup(
    jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(jPanel3Layout.createSequentialGroup()
    .add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 916, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
    .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    jPanel3Layout.setVerticalGroup(
    jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(jScrollPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 410, Short.MAX_VALUE)
    jScrollPane1.setViewportView(jPanel3);
    jSplitPane.setLeftComponent(jScrollPane1);
    jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
    jLabel1.setText("First Name:");
    jLabel2.setText("Last Name:");
    jLabel3.setText("Position :");
    jLabel4.setText("Department:");
    jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Search Results"));
    jGrid.setModel(new javax.swing.table.DefaultTableModel(
    new Object [][] {
    new String [] {
    "LName", "FName", "Position", "Department", "Office No", "Local No", "Office Mobile No", "Home No", "MobileNo", "Email Address"
    jGrid.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
    jGrid.setColumnSelectionAllowed(true);
    jGrid.setName("");
    jGrid.setTableHeader(jGrid.getTableHeader());
    jScrollPane3.setViewportView(jGrid);
    jScrollPane3.getAccessibleContext().setAccessibleName("rset");
    org.jdesktop.layout.GroupLayout jPanel5Layout = new org.jdesktop.layout.GroupLayout(jPanel5);
    jPanel5.setLayout(jPanel5Layout);
    jPanel5Layout.setHorizontalGroup(
    jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(jScrollPane3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 386, Short.MAX_VALUE)
    jPanel5Layout.setVerticalGroup(
    jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(jScrollPane3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 175, Short.MAX_VALUE)
    jButton1.setText("Find");
    jButton1.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButton1ActionPerformed(evt);
    jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
    public void mouseClicked(java.awt.event.MouseEvent evt) {
    jButton1MouseClicked(evt);
    jButton2.setText("Clear");
    jButton2.addMouseListener(new java.awt.event.MouseAdapter() {
    public void mouseClicked(java.awt.event.MouseEvent evt) {
    jButton2MouseClicked(evt);
    org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(jPanel4);
    jPanel4.setLayout(jPanel4Layout);
    jPanel4Layout.setHorizontalGroup(
    jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel4Layout.createSequentialGroup()
    .addContainerGap()
    .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
    .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel4Layout.createSequentialGroup()
    .add(jLabel1)
    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
    .add(jTextField1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE))
    .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel4Layout.createSequentialGroup()
    .add(jLabel2)
    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
    .add(jTextField2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE)
    .add(1, 1, 1))
    .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel4Layout.createSequentialGroup()
    .add(jLabel3)
    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
    .add(jTextField3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 138, Short.MAX_VALUE)
    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
    .add(jLabel4)
    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
    .add(jTextField4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 138, Short.MAX_VALUE))
    .add(jPanel4Layout.createSequentialGroup()
    .add(jButton1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 66, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
    .add(jButton2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 66, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
    .addContainerGap())
    jPanel4Layout.linkSize(new java.awt.Component[] {jButton1, jButton2}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
    jPanel4Layout.setVerticalGroup(
    jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(jPanel4Layout.createSequentialGroup()
    .addContainerGap()
    .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
    .add(jLabel1)
    .add(jTextField1))
    .add(18, 18, 18)
    .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
    .add(jLabel2)
    .add(jTextField2))
    .add(16, 16, 16)
    .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
    .add(jLabel3)
    .add(jTextField3)
    .add(jLabel4)
    .add(jTextField4))
    .add(14, 14, 14)
    .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
    .add(jButton2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .add(jButton1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
    .add(jPanel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
    jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
    .addContainerGap()
    .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
    .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .add(org.jdesktop.layout.GroupLayout.LEADING, jProgressBar1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 438, Short.MAX_VALUE))
    .addContainerGap())
    jPanel1Layout.setVerticalGroup(
    jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
    .addContainerGap()
    .add(jPanel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
    .add(jProgressBar1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
    jTabbedPane1.addTab("Search", jPanel1);
    org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(
    jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(0, 458, Short.MAX_VALUE)
    jPanel2Layout.setVerticalGroup(
    jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(0, 401, Short.MAX_VALUE)
    jTabbedPane1.addTab("Directory", jPanel2);
    jSplitPane.setRightComponent(jTabbedPane1);
    org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(jSplitPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 675, Short.MAX_VALUE)
    layout.setVerticalGroup(
    layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(jSplitPane)
    pack();
    }// </editor-fold>//GEN-END:initComponents
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
    }//GEN-LAST:event_jButton1ActionPerformed
    private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseClicked
    jGrid.setModel(new javax.swing.table.DefaultTableModel(
    new Object [][] {
    {null, null, null, null, null, null, null, null, null, null},
    {null, null, null, null, null, null, null, null, null, null},
    {null, null, null, null, null, null, null, null, null, null},
    {null, null, null, null, null, null, null, null, null, null}
    new String [] {
    "LName", "FName", "Position", "Department", "Office No", "Local No", "Office Mobile No", "Home No", "MobileNo", "Email Address"
    jGrid.updateUI();
    }//GEN-LAST:event_jButton2MouseClicked
    private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked
    try {
    //Load and register SQL Server driver
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    //Establish a connection
    Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://X.X.X.X:1433","MyAccount","MyPassword");
    //Create a Statement object
    Statement sql_stmt = connection.createStatement();
    //Create a ResultSet object, execute the query and return a
    // resultset
    ResultSet rset = sql_stmt.executeQuery("SELECT * FROM EpxDirectory..Directory Order By LName");
    // Populates a JTABLE Object
    int i=0;
    while (rset.next()){
    String LName = rset.getString(1);
    String FName = rset.getString(2);
    String Position = rset.getString(3);
    String Dept_Code = rset.getString(4);
    String OffPhoneNo = rset.getString(5);
    String LocalNo = rset.getString(6);
    String OffMobileNo = rset.getString(7);
    String HomePhoneNo = rset.getString(8);
    String MobileNo = rset.getString(9);
    String Email = rset.getString(10);
    jGrid.updateUI();
    jGrid.setValueAt(rset.getString(1).trim(),i,0);
    jGrid.setValueAt(rset.getString(2).trim(),i,1);
    jGrid.setValueAt(rset.getString(3).trim(),i,2);
    jGrid.setValueAt(rset.getString(4).trim(),i,3);
    jGrid.setValueAt(rset.getString(5).trim(),i,4);
    jGrid.setValueAt(rset.getString(6).trim(),i,5);
    jGrid.setValueAt(rset.getString(7).trim(),i,6);
    jGrid.setValueAt(rset.getString(8).trim(),i,7);
    jGrid.setValueAt(rset.getString(9).trim(),i,8);
    jGrid.setValueAt(rset.getString(10).trim(),i,9);
    i++;
    //Close the ResultSet and Statement
    rset.close();
    sql_stmt.close();
    //Close the database connection
    connection.close();
    System.out.println(Integer.toString(i) + " rows found");
    } catch(Exception e) {
    System.out.println("Failed to connect; Please view Stack Trace");
    e.printStackTrace();
    }//GEN-LAST:event_jButton1MouseClicked
    private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
    }//GEN-LAST:event_formWindowOpened
    public static void run(){
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    frmMain frmMain = new frmMain();
    frmMain.setLocationRelativeTo(null); // Center the JFrame on the
    frmMain.setVisible(true);
    private void exitApplication() {
    // try {
    // //gui.putStatus("Closing the connection....please wait.....");
    // if(connection != null) {
    // // connection.close(); //Closing the connection object.
    // } catch(SQLException ex) { //Trap SQLException
    // //gui.putStatus(ex.toString());
    System.exit(0); //Exit the aplication
    * @param args the command line arguments
    public static void main(String args[]) {
    run();
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JTable jGrid;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JProgressBar jProgressBar1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JSplitPane jSplitPane;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField3;
    private javax.swing.JTextField jTextField4;
    private javax.swing.JTree jTree1;
    // End of variables declaration//GEN-END:variables
    }

    Use code tags.
    Don't mix GUI and JDBC together. Split them out into separate classes.
    You have a good start, but you will need to loop through your resultset and also pull the ResultSet metaData for you column headings

  • Need Help Trying to Populate Cross Tab in SAP BO WEBI

    Hi,
    I know in MS Excel I can  Drop Data into the Row and Column Label and get the following Cross Tab:
                                          HouseA     HouseB     HouseC
    Elevator Bank One     1     
    Elevator Bank Two                                      1
    Elevator Bank Three                               1
    I truly how this makes sense and if it doesn't, I understand and will keep looking.
    I need in SAP WEBI to be able to do the same thing.
    I have the Cross Tab created in Webi, but can't see how to populate the Rows of Elevator Banks to display which houses have Elevator banks.
    I want to show Elevator Bank 1 is in House A, Elevator Bank Two is in House B     as well as Eleveaotr Bank Three begin in House B
    This is just an example.
    Trying to Populate the Webi Cross Tab is driving me crazy.
    I have the Lay out but can't populate the data.
    The data contact is Alpha Characters, but I want just the Numeric Values
    When I go to MS Excel 2007 and Pivot this, I drop down the Eleveators into the Rows and Drop the Houses into the Column as well as the Value and the numerical values populate for me.
    Can't for the life of me figure out how it works in SAP WEBI
    Again, I hope this makes sense and if not, I'll keep looking.

    Issue resolved.
    I needed to created a message for HouseA, B and C which provided the item count needed
    Something like the following:
    Measure One
    Occupied: =Count([Elevator Bank One]) Where ([House A]="Occupied")
    Measure Two
    Vacant: =Count([Elevator Bank Two]) Where ([HOUSE B]="Vacant")
    Measure Three
    Unknown: =Count([Elevator Bank Three]) Where ([HOUSE C)]="UNKNOWN")

  • Error While Trying To Populate Data .....Invalid Row ID

    Hi ,
    I have created a form wherein the user enters details and presses save . The data on the form level is populated in a Custom Table . Some attributes of the table are programatically populated and some attributes are tagged to UI Components on the Form Level.
    When the user presses Save the following Error Occurs
    oracle.apps.fnd.framework.OAException: oracle.jbo.DMLException: JBO-26080: Error while selecting entity for TcsAssocFrontEndSegLookUpEO
         at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:888)
         at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1145)
         at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(OAPageErrorHandler.java:1408)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormData(OAPageBean.java:2517)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1647)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418)
         at OA.jspService(OA.jsp:40)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:534)
    ## Detail 0 ##
    java.sql.SQLException: ORA-01410: invalid ROWID
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:583)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1983)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1141)
         at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2487)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2854)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:622)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:550)
         at oracle.jbo.server.OracleSQLBuilderImpl.doEntitySelect(OracleSQLBuilderImpl.java:614)
         at oracle.jbo.server.EntityImpl.doSelect(EntityImpl.java:4962)
         at oracle.apps.fnd.framework.server.OAEntityImpl.doSelect(OAEntityImpl.java:1684)
         at oracle.jbo.server.EntityImpl.populate(EntityImpl.java:4122)
         at oracle.jbo.server.EntityDefImpl.findFromDatabase(EntityDefImpl.java:889)
         at oracle.jbo.server.EntityDefImpl.findByPrimaryKey(EntityDefImpl.java:1069)
         at oracle.jbo.server.QueryCollection.findByKey(QueryCollection.java:2944)
         at oracle.jbo.server.ViewRowSetImpl.findByKey(ViewRowSetImpl.java:3072)
         at oracle.jbo.server.ViewRowSetImpl.findByKey(ViewRowSetImpl.java:3004)
         at oracle.jbo.server.ViewRowSetImpl.findByKey(ViewRowSetImpl.java:2998)
         at oracle.jbo.server.ViewObjectImpl.findByKey(ViewObjectImpl.java:6450)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.findByKey(OAViewObjectImpl.java:456)
         at oracle.apps.fnd.framework.webui.OAWebBeanDataAttributeHelper.checkAttributes(OAWebBeanDataAttributeHelper.java:1129)
         at oracle.apps.fnd.framework.webui.OAWebBeanDataAttributeHelper.getViewObjectRow(OAWebBeanDataAttributeHelper.java:773)
         at oracle.apps.fnd.framework.webui.OAWebBeanDataAttributeHelper.setValue(OAWebBeanDataAttributeHelper.java:496)
         at oracle.apps.fnd.framework.webui.OAWebBeanFormElementHelper.setValue(OAWebBeanFormElementHelper.java:445)
         at oracle.apps.fnd.framework.webui.OAWebBeanTextInputHelper.setValue(OAWebBeanTextInputHelper.java:161)
         at oracle.apps.fnd.framework.webui.OAWebBeanFormElementHelper.processFormAttribute(OAWebBeanFormElementHelper.java:407)
         at oracle.apps.fnd.framework.webui.OAWebBeanFormElementHelper.processFormDataAfterController(OAWebBeanFormElementHelper.java:340)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormData(OAWebBeanHelper.java:757)
         at oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean.processFormData(OAMessageTextInputBean.java:488)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataIndexedChildren(OAWebBeanHelper.java:1068)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataChildren(OAWebBeanHelper.java:1024)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataChildren(OAWebBeanHelper.java:1018)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormData(OAWebBeanHelper.java:758)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormData(OAWebBeanContainerHelper.java:662)
         at oracle.apps.fnd.framework.webui.beans.layout.OACellFormatBean.processFormData(OACellFormatBean.java:416)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataIndexedChildren(OAWebBeanHelper.java:1068)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataChildren(OAWebBeanHelper.java:1024)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataChildren(OAWebBeanHelper.java:1018)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormData(OAWebBeanHelper.java:758)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormData(OAWebBeanContainerHelper.java:662)
         at oracle.apps.fnd.framework.webui.beans.layout.OARowLayoutBean.processFormData(OARowLayoutBean.java:352)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataIndexedChildren(OAWebBeanHelper.java:1068)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataChildren(OAWebBeanHelper.java:1024)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataChildren(OAWebBeanHelper.java:1018)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormData(OAWebBeanHelper.java:758)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormData(OAWebBeanContainerHelper.java:662)
         at oracle.apps.fnd.framework.webui.beans.layout.OATableLayoutBean.processFormData(OATableLayoutBean.java:354)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataIndexedChildren(OAWebBeanHelper.java:1068)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataChildren(OAWebBeanHelper.java:1024)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataChildren(OAWebBeanHelper.java:1018)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormData(OAWebBeanHelper.java:758)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormData(OAWebBeanContainerHelper.java:662)
         at oracle.apps.fnd.framework.webui.beans.layout.OAContentContainerBean.processFormData(OAContentContainerBean.java:353)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataIndexedChildren(OAWebBeanHelper.java:1068)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataChildren(OAWebBeanHelper.java:1024)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataChildren(OAWebBeanHelper.java:1018)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormData(OAWebBeanHelper.java:758)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormData(OAWebBeanContainerHelper.java:662)
         at oracle.apps.fnd.framework.webui.beans.layout.OAHeaderBean.processFormData(OAHeaderBean.java:394)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataIndexedChildren(OAWebBeanHelper.java:1068)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataChildren(OAWebBeanHelper.java:1024)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataChildren(OAWebBeanHelper.java:1018)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormData(OAWebBeanHelper.java:758)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormData(OAWebBeanContainerHelper.java:662)
         at oracle.apps.fnd.framework.webui.OASubTabLayoutHelper.processFormData(OASubTabLayoutHelper.java:524)
         at oracle.apps.fnd.framework.webui.beans.layout.OASubTabLayoutBean.processFormData(OASubTabLayoutBean.java:470)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataIndexedChildren(OAWebBeanHelper.java:1068)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataChildren(OAWebBeanHelper.java:1024)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataChildren(OAWebBeanHelper.java:1018)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormData(OAWebBeanHelper.java:758)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormData(OAWebBeanContainerHelper.java:662)
         at oracle.apps.fnd.framework.webui.beans.layout.OAStackLayoutBean.processFormData(OAStackLayoutBean.java:356)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataIndexedChildren(OAWebBeanHelper.java:1068)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataChildren(OAWebBeanHelper.java:1024)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataChildren(OAWebBeanHelper.java:1018)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormData(OAWebBeanHelper.java:758)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormData(OAWebBeanContainerHelper.java:662)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormData(OAPageLayoutBean.java:1574)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataIndexedChildren(OAWebBeanHelper.java:1068)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataChildren(OAWebBeanHelper.java:1024)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataChildren(OAWebBeanHelper.java:1018)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormData(OAWebBeanHelper.java:758)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormData(OAWebBeanContainerHelper.java:662)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormData(OAFormBean.java:390)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataIndexedChildren(OAWebBeanHelper.java:1068)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataChildren(OAWebBeanHelper.java:1024)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormDataChildren(OAWebBeanHelper.java:1018)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormData(OAWebBeanHelper.java:758)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormData(OAWebBeanContainerHelper.java:662)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormData(OABodyBean.java:358)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormData(OAPageBean.java:2505)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1647)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418)
         at OA.jspService(OA.jsp:40)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:534)
    java.sql.SQLException: ORA-01410: invalid ROWID
    I am wondering if the error is occuring due to the fact that i am partly populating the data declaratively and partly programatically ?
    Kindly Help ,
    Thanks

    Thanks Mani ,
    The table being populated is a customised table . It has[b] no primary key . All the columns are[b] nullable . The VO that i am using is taking rowid as Primary Key By default. I am not explicitly setting rowId .

  • Error while trying to populate a table and refreshing

    Hello,
    I have created a java class in which i have the POJO's(non BC) and generated data controls off the java class. The java class also contains a list (of user defined objects - lstPriceeventTypes) which i have dropped as a table on a jspx.
    When i create a page: The list is initially empty. Now when i try to add a row using a command tool bar button which inturn invokes a method addSomething() in that same java class; in this method - i create the user defined object and add it to the list. Now i am expecting the table to show one row after i exit the addSomething method.
    The problem: the table is not getting refreshed.
    I tried
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding =
    bindings.getOperationBinding("Execute"); // ID of the execute action binding you've created in your pagedef as above
    System.out.println("bef ex");
    Object result = operationBinding.execute();
    with the pagdef having the entry
    <action IterBinding="lstPriceeventTypesIterator" id="Execute"
    RequiresUpdateModel="true" Action="iteratorExecute"/>
    The method getBindings has
    public BindingContainer getBindings() {
    if (this.bindings == null) {
    FacesContext fc = FacesContext.getCurrentInstance();
    this.bindings = (
    BindingContainer)fc.getApplication().evaluateExpressionGet(fc,
    "#{bindings}",
    BindingContainer.class);
    return this.bindings;
    So when i click on the button which accesses the method above; It throws the exception
    WARNING: ADF: Adding the following JSF error message: Unexpected exception caught: java.lang.NoClassDefFoundError, msg=javax/faces/context/FacesContext
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.lang.NoClassDefFoundError, msg=javax/faces/context/FacesContext
         at oracle.adf.model.binding.DCInvokeMethod.invokeMethod(DCInvokeMethod.java:603)
         at oracle.adf.model.binding.DCDataControl.invokeMethod(DCDataControl.java:2112)
    I do have FacesContext in my library. Any pointers please?

    It seemed to work:
    Changed the following -
    BindingContainer bindings = JUMetaObjectManager.getJUMom().getBindingContext().getCurrentBindingsEntry();
    used a commandtoolbar button with partialSubmit="true" and the table having a partial trigger on the button (partialTriggers="::ctb1")
    a normal commandButton wouldnt require a partialTrigger.....
    Any idea if getting the bindingcontainer in this way is correct "JUMetaObjectManager.getJUMom().getBindingContext().getCurrentBindingsEntry();

  • Data in DataSets, but error when trying to populate Crystal Report

    I have been in the process of making changes to a legacy application as described in this post.  [Error received on windows application|Error received on windows application]
    I have changed the references from 10.0 to 10.2.  The application included references to CrystalDecisions.CrystalReports.Design, CrystalDecisions.Enterprise.Framework and CrystalDecisions.Enterprise.InfoStore which did not have a comparable version in 10.2, so for the moment I have removed them.
    I have then tried to run the application (compiles fine) and run into this error:
    A first chance exception of type 'System.Exception' occurred in CrystalDecisions.CrystalReports.Engine.dll
    The code where it fails is here, when it is trying to load it into the report:
            private void SendDailyRentalDataToCrystal()
                crystalFailure = false;
                try
                    crystalDailyRentalReport.Database.Tables["ReportParameters"].SetDataSource(dsDailyRentalParameters);
                    crystalDailyRentalReport.Database.Tables["ReportData"].SetDataSource(dsDailyRentalData);
                catch
                    crystalFailure = true;
                    string error = "Unable to generate the Daily Rental Report.
                    error += "There was a problem sending the data to Crystal Reports.";
                    System.Windows.Forms.MessageBox.Show(error, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
    The DataSet visualizers for dsDailyRentalParameters and for dsDailyRentalData both indicate that there is valid data being returned from SQL Server.  This code is part of a Win32 application developed using VS 2005 and the reports were originally developed using Crystal Reports 10.
    Thanks for any help that you can provide.

    Ludek-
    It appears that during the course of trying to rectify the CR versioning issues that I had, I altered the functionality of the application.  This morning I reverted back to the previous version of my application and started over on the changes.  After all, I only had a couple small changes to make.
    I now have a functioning application.  However, I am not sure exactly what the cause of the last issue that I was fighting or how to fix it.
    Anyway, thanks much for the assistance that you provided.
    Regards,
    Scott

  • Trying to populate a table with data from WebRowset

    Hi,
    I want to be able to populate my tables with data from WebRowsets that have been saved to files. Everything goes good until I get to acceptChanges(). At which point I get a NullPointerException.
    Here's the code...
    WebRowSet wrs = new WebRowSetImpl();
    FileReader reader = new FileReader(inputFile);
    wrs.readXml(reader);
    wrs.beforeFirst();
    CachedRowSet crs = new CachedRowSetImpl();
    crs.setSyncProvider("com.sun.rowset.providers.RIXMLProvider");
    crs.populate(wrs);
    crs.beforeFirst();
    crs.acceptChanges(con);
    Results in...
    java.lang.NullPointerException
    at com.sun.rowset.CachedRowSetImpl.acceptChanges(CachedRowSetImpl.java:867)
    at com.sun.rowset.CachedRowSetImpl.acceptChanges(CachedRowSetImpl.java:919)
    I'm using Java 1.5_02. I looked at the source code for CachedRowSetImpl, and the only thing I could think of is that maybe "provider.getRowSetWriter()" in the following snippet is returning null....
    public void setSyncProvider(String s)
    throws SQLException
    provider = SyncFactory.getInstance(s);
    rowSetReader = provider.getRowSetReader();
    rowSetWriter = (TransactionalWriter)provider.getRowSetWriter();
    Any ideas?? Thanks!

    I have the same problem after setting com.sun.rowset.providers.RIXMLProvider.
    Looks like a bug to me.
    By the way, why are you creating a new CachedRowSet and populate it with a WebRowset (which extends CachedRowSet)?

  • Got error when trying to populate JSP from ActionServlet......Help me

    Hi Guys,
    In My application, I need to search a directory on my machine like if i give abc, it should display all files that match "abc". For that i have a Jsp page which accepts the pattern and am using MVC architecture for developing this application and I got this error when i ran the application. My jsp page:
    <body>
    <html:form action="/searchPattern">
    <TABLE border="0">
    <TBODY>     <TR>
         <TH>File Pattern</TH>
         <TD><html:text property="pattern" /></TD></TR>          <TR><TD><html:submit property="submit" value="Submit" /></TD></TR>
    </TBODY>
    </TABLE>
    </html:form>
    </body>
    another Jsp for displaying the results:
    <body>
    <jsp:useBean class="com.mot.struts.form.SearchForm" id="fileDetail" scope="session"/>
    <table>     
    <tr><td>File Names</td>
         <td><jsp:getProperty name="fileDetail" property="pattern"/></td>
         <td><ul>
         <logic:iterate name="fileDetail" property="listFiles"
         id="fileDetails" scope="session">               
         <li><bean:write name="fileDetails" property="listFiles" />
         </li>                
         </logic:iterate>
         </ul></td>
         </tr>
    </table>
    </body>
    and the Action servlet is:
    public ActionForward execute(ActionMapping mapping, ActionForm form,
                   HttpServletRequest request, HttpServletResponse response) {
         SearchForm searchForm = (SearchForm) form;
    String pattern=request.getParameter("pattern");
    File dir = new File("D:\\satish\\archive");
    System.out.println("Searching....");               
    File[] children=dir.listFiles();
    for (int i=0; i<children.length; i++) {
    String fileMatch=children.getAbsoluteFile().getName();
    if(fileMatch.contains(pattern)==true){      
    System.out.println("File pattern with .log found, File Name "+ fileMatch);
              request.setAttribute("fileDetail", searchForm);           
    return mapping.findForward("success");
    else{
    System.out.println("File pattern does not found");
    return mapping.findForward("failure");
    and the FormBean is:
    public class SearchForm extends ActionForm {
         private List pattern;
         private List fileName;
         private List listFiles;
         public SearchForm(){          
         public SearchForm(List pattern, List fileName, List listFiles){
              this.pattern=pattern;
              this.fileName=fileName;
              this.listFiles=listFiles;
         public static class Files{          
         private Object fName;
         public Files(){               
         public Files(Object fName){               
         this.fName=fName;
         public Object getFName() {
         return fName;
         public void setFName(Object name) {
         fName = name;
         public List getListFiles() {
         int size=pattern.size();
         List listFiles=new ArrayList(size);
    for( int p = 0; p < size; p++ ) {
         listFiles.add(new Files(fileName.get(p)));
         return listFiles;
         public void setListFiles(List listFiles) {
              this.listFiles = listFiles;
         public List getPattern() {
              return pattern;
         public void setPattern(List pattern) {
              this.pattern = pattern;
         public List getFileName() {
              return fileName;
         public void setFileName(List fileName) {
              this.fileName = fileName;
    and I got the following error:
    javax.servlet.ServletException: BeanUtils.populate
         org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1254)
    .........root cause:
    java.lang.IllegalArgumentException: argument type mismatch
         sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    Plz help me in solving this

    your form bean probably has a property that was declared using the wrong data type

  • Trying to update a JTable w/ new info

    I've had some issue understanding the change events in the tutorial found here. http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#simple I've mostly gotten it, with the exception that my data does not change. I'm fairly certain it has to do with the tableChanged method. As always any help is GREATLY appreciated thanks.
    This is a simple JFrame containing a Table with a JButton that changes the value of my data variable.
    The tableChanged method is basically straight copied, what do I need to do for the entire table to update?
    package testtable;
    import javax.swing.JFrame;
    import javax.swing.JTable;
    import javax.swing.JScrollPane;
    import java.awt.Dimension;
    import java.awt.BorderLayout;
    import javax.swing.table.AbstractTableModel;
    import javax.swing.table.TableModel;
    import javax.swing.event.TableModelListener;
    import javax.swing.event.TableModelEvent;
    import javax.swing.JButton;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    * @author rico
    public class TestTable implements TableModelListener {
        //this method is verbatim out of the tutorial
        public void tableChanged(TableModelEvent e) {
            int row = e.getFirstRow();
            int column = e.getColumn();
            TableModel model1 = (TableModel)e.getSource();
            String columnName = model.getColumnName(column);
            Object data3 = model.getValueAt(row, column);
            // Do something with the data...
            static String[] columnNames = {"First Name", "Last Name", "Sport", "# of Years", "Vegetarian"};
            static Object[][] data = {
                {"Mary", "Campione",
                 "Snowboarding", new Integer(5), new Boolean(false)},
                {"Alison", "Huml",
                 "Rowing", new Integer(3), new Boolean(true)},
                {"Kathy", "Walrath",
                 "Knitting", new Integer(2), new Boolean(false)},
                {"Sharon", "Zakhour",
                 "Speed reading", new Integer(20), new Boolean(true)},
                {"Philip", "Milne",
                 "Pool", new Integer(10), new Boolean(false)}
            static Object[][] data2 = {
                {"Cunt", "Campione",
                 "Snowboarding", new Integer(5), new Boolean(false)},
                {"Alison", "Huml",
                 "Rowing", new Integer(3), new Boolean(true)},
                {"Kathy", "Walrath",
                 "muff-diving", new Integer(2), new Boolean(false)},
                {"Sharon", "Zakhour",
                 "Motor_boating", new Integer(20), new Boolean(true)},
                {"Philip", "Milne",
                 "Pool", new Integer(10), new Boolean(false)}
            static AbstractTableModel model = new AbstractTableModel() {
                public Object getValueAt(int row, int col) {
                    return data[row][col];
                public int getColumnCount() {
                    return columnNames.length;
                public int getRowCount() {
                    return data.length;
                @Override
                public void setValueAt(Object value, int row, int col) {
                    data[row][col] = value;
                    fireTableDataChanged();
         * @param args the command line arguments
        public static void main(String[] args) {
            JFrame frame = new JFrame("TestTable");
            frame.setSize(500, 500);
            JButton button = new JButton("button");
            button.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    data = data2;
            JTable table = new JTable(model);
            table.getModel().addTableModelListener(table);
            JScrollPane pane = new JScrollPane(table);
            pane.setPreferredSize(new Dimension(400, 200));
            frame.add(pane, BorderLayout.NORTH);
            frame.add(button, BorderLayout.SOUTH);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);
    }Edited by: rico16135 on Aug 30, 2008 4:13 AM

    There is no need to extend AbstractTableModel in this example.
    You can just create a DefaultTableModel using data and columnNames.
    If you want to display data2 inside the table create a new DefaultTableModel with data2 and use table.setModel to update the table.

  • I am trying to populate a form

    Hi,
    I created a form based on a table. When I run the the form it is not populated. I have an "automated row fetch" page process. I have tried most of the process point options with no success. I put a message in the message box for success and failure. I receive the success message but no data is populated. I am used to programming Oracle Forms where the Items are populated using an execute query. How can I my Items populated? Is there something like execute query in Apex?

    Hello:
    The ARF needs to be told what record it is to fetch. Unlike Oracle Forms you cant simply do a 'Run Query' here. So, in navigating to the form page you need to set the page-item corresponding to the PK column to the value of the PK column in the row to be fetched.
    I suggest you try the tutorial described here http://download.oracle.com/docs/cd/E14373_01/appdev.32/e13367/build_app.htm#insertedID5 to understand how the ARF process works.
    varad

  • Has anybody tried this multirow header JTable sample?

    Hi,
    http://www2.gol.com/users/tame/swing/examples/JTableExamples1.html
    I found a link to this sample from this forum, and I need to implement a similar functionality. I tried running the code of this sample but it returns a "NullPointerException" for the call "GetHeaderRenderer" in the class "GroupableTableHeaderUI".
    Has anybody tried this, and if so, how do I get this sample to work ??
    Thanks,
    R.

    I ran into this problem a while ago. If you are using SDK 1.3 and above, tame's example won't work. You need to some minor modification in the "GroupableTableHeaderUI" java file. I have already made it work under SDK 1.3.02. I don't have the source code at home. So, if you need to take look at my source code please let me know, I can either e-mail or post it when I return to my office.
    Kenny :}

  • JTables-whats the story with them?

    we are trying to populate a JTable from a mySql database. but are having trouble creating the table. if anyone has any idea how to do this or knows a site which could help that would be great. we are using veactors to create the table, and are having prblems with this. And problems displaying the table. any help would be much appreciated
    cheers

    best place to start:
    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html

  • JTable SLOW to fill

    I am trying to populate a JTable from a ResultSet. The ResultSet is about 30 x 30 and takes almost 30 seconds to populate the table and display ANY HELP would be GREATLY apprieciatted. Here is my code:
    public void RetrieveCompanyData(boolean all)
        foundIt = false;
        ResultSet rs = null;
        try{
            int row = companyTmodel.getRowCount(); // companyTmodel is the DefaultTableModel
            while(row > 0){
               row--;
               companyTmodel.removeRow(row);
            if (all){
                rs = CompanyDA.RetrieveAllCompanies();
            else{
                 rs = CompanyDA.SearchFor(companyName,address,city,state,zip,areaCode,
    phone,fax,industry,subCategory,revenue,employees,industrySegment,leadSource,symbol,ranking,globalCompanies,headquarters);
            //get metadata
            ResultSetMetaData md = rs.getMetaData();
            int colcount = md.getColumnCount();
            Object[] data = new Object[colcount];
             // extracting data
            while (rs.next()){
                foundIt = true;
                for (int i=1; i<=colcount; i++){
                    data[i-1] = rs.getString(i);
                    companyTmodel.addRow(data);
        catch(Exception e) {System.out.println(e);}
    }

    OK, I found something interesting. Here is how I create the ResultSet:
        public static ResultSet RetrieveAllCompanies(){
           ResultSet rs = null;
    // Here is the problem,
    //if I add any of the following rows, or just uses any one of these rows by themselves
    //in the SELECT statment, the performance drops.
    //But if I leave these rows out
    //I get the results back in under a second
    /// Fields ///
    // s.Status
    //s.Fax
    //s.LeadSource
    //s.Ranking
    //s.Notes
           // build query string
         String sql = "SELECT s.Date,c.CompanyID,c.CompanyName,c.Symbol,c.Rev_2003,c.Employees,c.Sub_Category, " +
              "s.MainOrSite,c.Industry,s.AreaCode,s.Phone,s.Web,s.Address,s.Addr2,s.City, " +
              "s.State,s.Zip,c.IndustrySeg3,s.Country,s.Global,s.Province,s.GlobalZip, " +
                 "c.Profit_2003,s.SiteUniqueId " +
                    "FROM Company c, Site s " +
                    "WHERE c.CompanyID = s.CompanyID" ;
         try
              // execute query
              rs = st.executeQuery(sql);
         catch(SQLException ee){System.out.println(ee);}
         catch(Exception e) {System.out.println(e);}
        return rs ;
    }I don't understand why these particular rows slow down my reading of the ResultSet. I have other rows of the same tyoe, and even bigger that don not effect the performance. Even if I run the SELECT query using only ONE of the problem fileds/columns I get the problem. Here is my table statement:
    CREATE TABLE Site(
            Date          VARCHAR(30),
            SiteUniqueId     MEDIUMINT NOT NULL AUTO_INCREMENT,
         CompanyID      MEDIUMINT NOT NULL,
           MainorSite     VARCHAR(20),
         areaCode     VARCHAR(5),
         phone          VARCHAR(20),
         status          VARCHAR(30),
         Web          VARCHAR(45),
         address          VARCHAR(30),
         addr2          VARCHAR(30),
         city          VARCHAR(30),
         state          VARCHAR(2),                              
         zip          VARCHAR(12),
         fax          VARCHAR(20),                    
         leadSource     VARCHAR(30),                         
           Country          VARCHAR (20),
         Province     VARCHAR     (30),
         GlobalZip     VARCHAR (30),                         
         ranking          VARCHAR(3),
         notes          VARCHAR(255),
         Global          VARCHAR (4),
         PRIMARY KEY (SiteUniqueid),
         FOREIGN KEY (CompanyID) REFERENCES Company(CompanyID)
         ) TYPE=INNODB;and here is my mySQL driver:
                  /// open database connection ///
                  // connection string
                   String dsn = "CompanyLookup";
                   //load driver
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   //make connection
                   con = DriverManager.getConnection("jdbc:odbc:" + dsn);
                   //create statement
                   st = con.createStatement();Thanks a million!!!

  • Sql select as

    Hi. I am trying to populate my JTable from a table in mysql server using the following statemetn.
    "select Station_Name, Frequency, Modulation, Status from my_table where status = 'good'"
    this is working fine and I am seeing my JTable populated with data.
    But, I wanted to change the name of the column names using the select asstatement as follows
    "select Station_Name as 'Station Name', Frequency as 'Station Frequency', Modulation as 'Modulation Type', Status as 'Signal Strength' from my_table where status = 'good'"  // this fails to populate my data! and the JTable becomes empty but the following line of code compiles fine "select Station_Name as 'Station Name', Frequency, Modulation, Status  from my_table where  // that is using the 'as' statement only once {code} tnx in advance                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    OK, so what happens when you use straight JDBC?
    That is, what happens if you do:
    resultSet.getString("Station Frequency");
    resultSet.getString("Modulation Type");with the renamed columns?
    If you get results, then it's not JDBC (or, more specifically, the driver you;re using...the MySQL one presumably). After all SELECT..AS..AS.. etc works fine with Oracle, since I'm doing that right now.

Maybe you are looking for

  • Two objects from one table

    My current setup is two tables and two objects with a one to one relationship between them, Object and ObjectMD (metadata). Not sure why my predecessors set it up like this but...that's how it is. The problem is that my Object table (and thus ObjectM

  • Features of Creative cloud 6

    Hey.....I am a newbie and i wish to go for CS6. Based on your personal experience, can someone please throw some light on the various applications such as Dreamweaver and photoshop that are there in CS6. I would also like to know your opinions on the

  • ORA-19511: A backup or restore session is already in progress. (100:17:0)

    Hi, I am duplicating a database as document explains. Legato support says that there's no session, neither can be seen in the target or catalog. ORA-19870: error reading backup piece full_open_IEBDPR01_h7k7ccrn_1575 ORA-19507: failed to retrieve sequ

  • SAP note - delete enhancement-point

    hi, I would like to implement a note ("992605"). In this note there were some correction instructions (e.g. "ES_MRYF_COMMON_ROUTINES_ALV"; Objecttype ENHS). If I open the link to the object (click on objectname), there are no details what to do. Now

  • Tv Card Winfast on emulator?

    I have WinFast Palmtop TV usb tv card,inside is chip conexant cx25843.How could I install this,I need walkthrough.Could I use cx88.Please help Last edited by nucleuswizard (2007-11-09 17:08:55)