Need help with inserting rows in resultset

hello!
i want to insert a row in my result set and i want that my table shows this row promptly after i have inserted it in my result set...
but when i use following code for my resultset:
rs.moveToInsertRow();
rs.updateInt(1,nr);
rs.updateString(2, name);
rs.insertRow();
and call fireTableDataChanged afterwards -> nothing happens, rows are inserted in resultset but not shown in my table??
anyone a clue??

rs.moveToInsertRow(); // moves cursor to the insert row
rs.updateString(1, "AINSWORTH"); // updates the
// first column of the insert row to be AINSWORTH
rs.updateInt(2,35); // updates the second column to be 35
rs.updateBoolean(3, true); // updates the third row to true
rs.insertRow();
rs.moveToCurrentRow();
This is from the JAVA API. Something makes me think you might want to try doing the last method execution.
rs.moveToCurrentRow();
Vijay

Similar Messages

  • Need help with inserting rows in ResultSet and JTable

    hello Guru!
    i have inserted a row in my result set and i want that my table shows this row promptly after i have inserted it in my result set...
    but when i use following code for my resultset:
    rs.moveToInsertRow();
    rs.updateInt(1,nr);
    rs.updateString(2, name);
    rs.insertRow();
    Record are inserted in resultset and database but not shown in my JTable??
    Anyone a Clue to without reexecuting the query how can i display inserted row in JTable
    http://download-west.oracle.com/docs/cd/A87860_01/doc/java.817/a83724/resltse7.h
    I have refrered the following links but still clue less help Guruuuuuuu
    i m really in trobble??????

    i am just near by the Solution using the Database Metadata
    by couldn't get the ideaaaa
    ==================================================
    http://download-west.oracle.com/docs/cd/A87860_01/doc/java.817/a83724/resltse7.htm
    Seeing Database Changes Made Internally and Externally
    This section discusses the ability of a result set to see the following:
    its own changes (DELETE, UPDATE, or INSERT operations within the result set), referred to as internal changes
    changes made from elsewhere (either from your own transaction outside the result set, or from other committed transactions), referred to as external changes
    Near the end of the section is a summary table.
    Note:
    External changes are referred to as "other's changes" in the Sun Microsystems JDBC 2.0 specification.
    Seeing Internal Changes
    The ability of an updatable result set to see its own changes depends on both the result set type and the kind of change (UPDATE, DELETE, or INSERT). This is discussed at various points throughout the "Updating Result Sets" section beginning on , and is summarized as follows:
    Internal DELETE operations are visible for scrollable result sets (scroll-sensitive or scroll-insensitive), but are not visible for forward-only result sets.
    After you delete a row in a scrollable result set, the preceding row becomes the new current row, and subsequent row numbers are updated accordingly.
    Internal UPDATE operations are always visible, regardless of the result set type (forward-only, scroll-sensitive, or scroll-insensitive).
    Internal INSERT operations are never visible, regardless of the result set type (neither forward-only, scroll-sensitive, nor scroll-insensitive).
    An internal change being "visible" essentially means that a subsequent getXXX() call will see the data changed by a preceding updateXXX() call on the same data item.
    JDBC 2.0 DatabaseMetaData objects include the following methods to verify this. Each takes a result set type as input (ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_SENSITIVE, or ResultSet.TYPE_SCROLL_INSENSITIVE).
    boolean ownDeletesAreVisible(int) throws SQLException
    boolean ownUpdatesAreVisible(int) throws SQLException
    boolean ownInsertsAreVisible(int) throws SQLException
    Note:
    When you make an internal change that causes a trigger to execute, the trigger changes are effectively external changes. However, if the trigger affects data in the row you are updating, you will see those changes for any scrollable/updatable result set, because an implicit row refetch occurs after the update.
    Seeing External Changes
    Only a scroll-sensitive result set can see external changes to the underlying database, and it can only see the changes from external UPDATE operations. Changes from external DELETE or INSERT operations are never visible.
    Note:
    Any discussion of seeing changes from outside the enclosing transaction presumes the transaction itself has an isolation level setting that allows the changes to be visible.
    For implementation details of scroll-sensitive result sets, including exactly how and how soon external updates become visible, see "Oracle Implementation of Scroll-Sensitive Result Sets".
    JDBC 2.0 DatabaseMetaData objects include the following methods to verify this. Each takes a result set type as input (ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_SENSITIVE, or ResultSet.TYPE_SCROLL_INSENSITIVE).
    boolean othersDeletesAreVisible(int) throws SQLException
    boolean othersUpdatesAreVisible(int) throws SQLException
    boolean othersInsertsAreVisible(int) throws SQLException
    Note:
    Explicit use of the refreshRow() method, described in "Refetching Rows", is distinct from this discussion of visibility. For example, even though external updates are "invisible" to a scroll-insensitive result set, you can explicitly refetch rows in a scroll-insensitive/updatable result set and retrieve external changes that have been made. "Visibility" refers only to the fact that the scroll-insensitive/updatable result set would not see such changes automatically and implicitly.
    Visibility versus Detection of External Changes
    Regarding changes made to the underlying database by external sources, there are two similar but distinct concepts with respect to visibility of the changes from your local result set:
    visibility of changes
    detection of changes
    A change being "visible" means that when you look at a row in the result set, you can see new data values from changes made by external sources to the corresponding row in the database.
    A change being "detected", however, means that the result set is aware that this is a new value since the result set was first populated.
    With Oracle8i release 8.1.6 and higher, even when an Oracle result set sees new data (as with an external UPDATE in a scroll-sensitive result set), it has no awareness that this data has changed since the result set was populated. Such changes are not "detected".
    JDBC 2.0 DatabaseMetaData objects include the following methods to verify this. Each takes a result set type as input (ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_SENSITIVE, or ResultSet.TYPE_SCROLL_INSENSITIVE).
    boolean deletesAreDetected(int) throws SQLException
    boolean updatesAreDetected(int) throws SQLException
    boolean insertsAreDetected(int) throws SQLException
    It follows, then, that result set methods specified by JDBC 2.0 to detect changes--rowDeleted(), rowUpdated(), and rowInserted()--will always return false with the 8.1.6 Oracle JDBC drivers. There is no use in calling them.
    Summary of Visibility of Internal and External Changes
    Table 12-1 summarizes the discussion in the preceding sections regarding whether a result set object in the Oracle JDBC implementation can see changes made internally through the result set itself, and changes made externally to the underlying database from elsewhere in your transaction or from other committed transactions.
    Table 12-1 Visibility of Internal and External Changes for Oracle JDBC
    Result Set Type Can See Internal DELETE? Can See Internal UPDATE? Can See Internal INSERT? Can See External DELETE? Can See External UPDATE? Can See External INSERT?
    forward-only
    no
    yes
    no
    no
    no
    no
    scroll-sensitive
    yes
    yes
    no
    no
    yes
    no
    scroll-insensitive
    yes
    yes
    no
    no
    no
    no
    For implementation details of scroll-sensitive result sets, including exactly how and how soon external updates become visible, see "Oracle Implementation of Scroll-Sensitive Result Sets".
    Notes:
    Remember that explicit use of the refreshRow() method, described in "Refetching Rows", is distinct from the concept of "visibility" of external changes. This is discussed in "Seeing External Changes".
    Remember that even when external changes are "visible", as with UPDATE operations underlying a scroll-sensitive result set, they are not "detected". The result set rowDeleted(), rowUpdated(), and rowInserted() methods always return false. This is further discussed in "Visibility versus Detection of External Changes".
    Oracle Implementation of Scroll-Sensitive Result Sets
    The Oracle implementation of scroll-sensitive result sets involves the concept of a window, with a window size that is based on the fetch size. The window size affects how often rows are updated in the result set.
    Once you establish a current row by moving to a specified row (as described in "Positioning in a Scrollable Result Set"), the window consists of the N rows in the result set starting with that row, where N is the fetch size being used by the result set (see "Fetch Size"). Note that there is no current row, and therefore no window, when a result set is first created. The default position is before the first row, which is not a valid current row.
    As you move from row to row, the window remains unchanged as long as the current row stays within that window. However, once you move to a new current row outside the window, you redefine the window to be the N rows starting with the new current row.
    Whenever the window is redefined, the N rows in the database corresponding to the rows in the new window are automatically refetched through an implicit call to the refreshRow() method (described in "Refetching Rows"), thereby updating the data throughout the new window.
    So external updates are not instantaneously visible in a scroll-sensitive result set; they are only visible after the automatic refetches just described.
    For a sample application that demonstrates the functionality of a scroll-sensitive result set, see "Scroll-Sensitive Result Set--ResultSet5.java".
    Note:
    Because this kind of refetching is not a highly efficient or optimized methodology, there are significant performance concerns. Consider carefully before using scroll-sensitive result sets as currently implemented. There is also a significant tradeoff between sensitivity and performance. The most sensitive result set is one with a fetch size of 1, which would result in the new current row being refetched every time you move between rows. However, this would have a significant impact on the performance of your application.
    how can i implement this using
    JDBC 2.0 DatabaseMetaData objects include the following methods to verify this. Each takes a result set type as input (ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_SENSITIVE, or ResultSet.TYPE_SCROLL_INSENSITIVE).
    boolean deletesAreDetected(int) throws SQLException
    boolean updatesAreDetected(int) throws SQLException
    boolean insertsAreDetected(int) throws SQLException

  • Need help with Pivoting rows to columns

    Hi,
    I need help with pivoting rows to columns. I know there are other posts regarding this, but my requirement is more complex and harder. So, please give me a solution for this.
    There are two tables say Table 1 and Table 2.
    Table1
    name address email identifier
    x e g 1
    f s d 2
    h e n 3
    k l b 4
    Table2
    identifier TRno zno bzid
    1 T11 z11 b11
    1 T12 z12 b12
    1 T13 z13 b13
    2 T21 z21 b21
    2 T22 z22 b22
    As you can see the identifier is the column that we use to map the two tables. The output should be like below
    output
    name address email identifier TRno1 zno1 bzid1 TRno2 zno2 bzid2 TRno3 zno3 bzid3
    x e g 1 T11 z11 b11 T12 z12 b12 T13 z13 b13
    f s d 2 T21 z21 b21 t22 z22 b22
    Also we do not know exactly how many TRno's, zno's, etc each value in the identifier will have. There may be only 1 TRNO, zno and bzid, or there may be four.
    All the values must be in separate columns, and not be just comma delimitted. There are also other conditions that i have to add to restrict the data.
    So, can you please tell me what is should use to get the data in the required format? We are using Oracle 10g. Please let me know if u need any more information

    Something like this ?
    SCOTT@orcl> ed
    Wrote file afiedt.buf
      1  select a.name,
      2  a.address,
      3  a.email,
      4  b.* from (
      5  select distinct identifier
      6  ,max(trno1) trno1
      7  ,max(zno1) zno1
      8  ,max(bzid1) bzid1
      9  ,max(trno2) trno2
    10  ,max(zno2) zno2
    11  ,max(bzid2) bzid2
    12  ,max(trno3) trno3
    13  ,max(zno3) zno3
    14  ,max(bzid3) bzid3
    15  ,max(trno4) trno4
    16  ,max(zno4) zno4
    17  ,max(bzid4) bzid4
    18  from (select identifier
    19  ,decode(rn,1,trno,null) trno1
    20  ,decode(rn,1,zno,null) zno1
    21  ,decode(rn,1,bzid,null) bzid1
    22  ,decode(rn,2,trno,null) trno2
    23  ,decode(rn,2,zno,null) zno2
    24  ,decode(rn,2,bzid,null) bzid2
    25  ,decode(rn,3,trno,null) trno3
    26  ,decode(rn,3,zno,null) zno3
    27  ,decode(rn,3,bzid,null) bzid3
    28  ,decode(rn,4,trno,null) trno4
    29  ,decode(rn,4,zno,null) zno4
    30  ,decode(rn,4,bzid,null) bzid4
    31  from (select identifier,
    32  trno,bzid,zno,
    33  dense_rank() over(partition by identifier order by trno,rownum) rn
    34  from table2)
    35  order by identifier)
    36  group by identifier) b,table1 a
    37* where a.identifier=b.identifier
    SCOTT@orcl> /
    NAME       ADDRESS    EMAIL      IDENTIFIER TRNO1      ZNO1       BZID1      TRNO2      ZNO2       BZID2      TRNO3      ZNO3       BZID3      TRNO4      ZNO4       BZID4
    x          e          g          1          T11        z11        b11        T12        z12        b12        T13        z13        b13
    f          s          d          2          T21        z21        b21        T22        z22        b22
    SCOTT@orcl> select * from table1;
    NAME       ADDRESS    EMAIL      IDENTIFIER
    x          e          g          1
    f          s          d          2
    h          e          n          3
    k          l          b          4
    SCOTT@orcl> select * from table2;
    IDENTIFIER TRNO       ZNO        BZID
    1          T11        z11        b11
    1          T12        z12        b12
    1          T13        z13        b13
    2          T21        z21        b21
    2          T22        z22        b22
    SCOTT@orcl>Regards
    Girish Sharma

  • Need Help with Inserting Timeline Markers

    Friends,
    I have not use my premiere element 3.2 since 2008 and forgot some of the procedures. now, I need help with the insertion of Timeline Markers. I did what the Help Page showed me. But the markers were not effective in the resulting DVD, or, even when viewing the video in the editing page as if thye were not there! Here is what I did:.
    1)  Click the Timeline button.
    2)  Click in an empty space in a video or audio track in the Timeline to make the Timeline active and deselect any clips.
    3)  Move the current-time indicator in the Timeline to the frame where I need the marker.
    4)  Click the Add Marker icon in the Timeline to place the Marker 5 times where I want them.
    5)  Verified that each Timeline Marker is present at the intended place.
    6)  Burned DVD
    7)  Can NOT jump to any of the intended Marker in the Resulting DVD during playback.
    The question is "What did I do wrong or didn't do?" It seems that I did the same before and worked! Please advise!
    Also, what are the significance of the Red line just below the Timeline and the yellow bars inside the video and audio frames. But after preforming Timeline/Render Work Area, they were all gone? What purposes do they serve and what is the significance of Rendering? Thank you for your help!
    I repeat the process and did a Rendering before making the DVD also. It did not help!
    Andy Lim

    Steve,
    Long time no talk! You used to help me out many times when the PE-1 through PE-3 came out. I was HOPING you would still be around and you are! You came through again this time! Many thanks to you.
    I use the Add DVD Scene button to insert the Markers. They are Green. Made a DVD and the markers work OK although ythey are "effective" during play back using the editing window.
    While that problem was solved, will you come back and answer the other two questions concerning Rendering and the Red/Yellow lines? I would appreciate it very much!
    Andy Lim
    ~~~~~~~~~~~~~~~~

  • Need help with INSERT and WITH clause

    I wrote sql statement which correctly work, but how i use this statment with INSERT query? NEED HELP. when i wrote insert i see error "ORA 32034: unsupported use of with clause"
    with t1 as(
    select a.budat,a.monat as period,b.vtweg,
    c.gjahr,c.buzei,c.shkzg,c.hkont, c.prctr,
    c.wrbtr,
    c.matnr,
    c.menge,
    a.monat,
    c.zuonr
    from ldw_v1.BKPF a,ldw_v1.vbrk b, ldw_v1.bseg c
    where a.AWTYP='VBRK' and a.BLART='RV' and a.BUKRS='8431' and a.awkey=b.vbeln
    and a.bukrs=c.bukrs and a.belnr=c.belnr and a.gjahr=c.gjahr and c.koart='D'
    and c.ktosl is null and c.gsber='4466' and a.gjahr>='2011' and b.vtweg='01'
    ,t2 as(
    select a.BUKRS,a.BELNR, a.GJAHR,t1.vtweg,t1.budat,t1.monat from t1, ldw_v1.bkpf a
    where t1.zuonr=a.xblnr and a.blart='WL' and bukrs='8431'
    ,tcogs as (
    select t2.budat,t2.monat,t2.vtweg, bseg.gjahr,bseg.hkont,bseg.prctr,
    sum(bseg.wrbtr) as COGS,bseg.matnr,bseg.kunnr,sum(bseg.menge) as QUANTITY
    from t2, ldw_v1.bseg
    where t2.bukrs=bseg.bukrs and t2.belnr=bseg.BELNR and t2.gjahr=bseg.gjahr and BSEG.KOART='S'
    group by t2.budat,t2.monat,t2.vtweg, bseg.gjahr,bseg.hkont,bseg.prctr,
    bseg.matnr,bseg.kunnr
    ,t3 as
    select a.budat,a.monat,b.vtweg,
    c.gjahr,c.buzei,c.shkzg,c.hkont, c.prctr,
    case when c.shkzg='S' then c.wrbtr*(-1)
    else c.wrbtr end as NTS,
    c.matnr,c.kunnr,
    c.menge*(-1) as Quantity
    from ldw_v1.BKPF a,ldw_v1.vbrk b, ldw_v1.bseg c
    where a.AWTYP='VBRK' and a.BLART='RV' and a.BUKRS='8431' and a.awkey=b.vbeln
    and a.bukrs=c.bukrs and a.belnr=c.belnr and a.gjahr=c.gjahr and c.koart='S'
    and c.ktosl is null and c.gsber='4466' and a.gjahr>='2011' and b.vtweg='01'
    ,trevenue as (
    select t3.budat,t3.monat,t3.vtweg, t3.gjahr,t3.hkont,t3.prctr,
    sum(t3.NTS) as NTS,t3.matnr,t3.kunnr,sum(t3.QUANTITY) as QUANTITY
    from t3
    group by t3.budat,t3.monat,t3.vtweg, t3.gjahr,t3.hkont,t3.prctr,t3.matnr,t3.kunnr
    select NVL(tr.budat,tc.budat) as budat,
    NVL(tr.monat,tc.monat) as monat,
    NVL(tr.vtweg,tc.vtweg) as vtweg,
    NVL(tr.gjahr, tc.gjahr) as gjahr,
    tr.hkont as NTS_hkont,
    tc.hkont as COGS_hkont,
    NVL(tr.prctr,tc.prctr) as prctr,
    NVL(tr.MATNR, tc.MATNR) as matnr,
    NVL(tr.kunnr, tc.kunnr) as kunnr,
    NVL(tr.Quantity, tc.Quantity) as Quantity,
    tr.NTS as NTS,
    tc.COGS as COGS
    from trevenue TR full outer join tcogs TC
    on TR.BUDAT=TC.BUDAT and TR.MONAT=TC.MONAT and TR.GJAHR=TC.GJAHR
    and TR.MATNR=TC.MATNR and TR.KUNNR=TC.KUNNR and TR.QUANTITY=TC.QUANTITY
    and TR.VTWEG=TC.VTWEG and TR.PRCTR=TC.PRCTR
    Edited by: user13566113 on 25.03.2011 5:26

    Without seeing what you tried it is hard to say what you did wrong, but this is how it would work
    SQL> create table t ( n number );
    Table created.
    SQL> insert into t
      2  with test_data as
      3    (select 1 x from dual union all
      4     select 2 x from dual union all
      5     select 3 x from dual union all
      6     select 4 x from dual)
      7  select x from test_data;
    4 rows created.
    SQL>

  • Need Help with inserting a screen shot

    Can someone pleassse help me?! If any of you are familiar with popular youtubers and how in their videos they include screen shots of facebook or twitter questions and they have them so they roll across the bottom  of the screen, can you please help me! If anyone knows how to do this in Imovie 11 it would be HUGELY appreciated! Because when i try the picture in picture settings it zooms the screen shot so its massive and its also not an oblong shape anymore (like the shape of a facebook reply) i also need help at how this would transition to roll in from one side of the screen to the other?!
    PLEASE HELP ME!!

    I think it is possible to do this in iMovie, although perhaps easier in Final Cut Pro X, which I would guess that iJustine is using.
    First, I would take a still image of my video at the points where I want to superimpose a graphic. Since she is mostly superimposing graphics on her talking head, a single still might be sufficient.
    For getting a still out of iMovie, see my User Tip here.
    https://discussions.apple.com/docs/DOC-3231
    Now, you will want to take this still to a photo editor that allows you to edit layers. Use PhotoShop if you have it. If you do not already have PhotoShop, it can be rather expensive, so I would suggest a tool like Acorn or Pixelmator, which I think are available in the Mac App Store.
    Create a project in the dimensions of your iMovie still, e.g. 1920x1080.
    You would put the still on the bottom layer, so you know where to put yoru graphics. You would position the graphic or screen grab at the next layer up. Now I would export the upper layer only as a PNG file. The PNG file has an Alpha Channel, which means you will see only the graphic and not the still in the background.
    The main thing Final Cut Pro would give you would be the easy ability to have multiple graphics on the screen at the same time.
    Now you can drag this PNG file into iMovie and drop it on the project clip where you want it to appear. A popup menu will appear. Choose Cutaway.
    There are probably other ways to do this, but that is the way I would do it.

  • Need help with inserting frame with scrolling images

    Hi,
        Im a beginner and need help putting a single box/frame with scrolling images in the middle of my layout, so that when viewed in browser, the header and footer remain in place, while the images and info in the frame in the centre of the page can be scrolled down/up?

    You can use an iframe element <iframe src="" width="" height="" scrolling="yes"> though if you're concerned with crawlers you should avoid frames as much as possible. 

  • Need help with inserting 10MB CLOB

    Hi,
    I have an urgent issue and desperately need some help.
    There are several files on a FTP server that I need to insert their contents into a CLOB type column. One of the files has more than 10MB contents. What I've been doing is after connection is made to the FTP server, read in the contents in a file line by line into a String, then execute a SQL INSERT statement to insert a new record into the target table.
    +//.... make connection, read in files and parse into a String variable called fileContents+
    String psInsert = "Insert into FileTrack (Name, Contents) values";
    PreparedStatment ps = conn.prepareStatement(psInsert "(?,?)");+
    ps.setString(1, "some name");
    ps.setObject(2, fileContents);
    ps.executeUpdate();
    The above works fine for all other smaller files, except the 10MB one. The error I got was SQLCODE: -302, SQLSTATE: 22001, which is about not enough space issue. So I increased the CLOB column size and made sure it doesn't exceed the initial CLOB size setting and the database has plenty of space for storing this 10MB file. Still, I got the same error.
    Then I tried the following:
    ps.setObject(2, fileContents, java.sql.Types.CLOB);
    Failed with same error...
    Then I tried this:
    FileInputStream inputStream = new FileInputStream(fileContents);
    ps.setAsciiStream(2, inputStream, (int)()fileContents.length()));
    Still failed with the same error....
    Then I changed to ps.setCharStream()... still failed....
    What other options do I have to insert the 10MB contents? Can someone please help?
    Thanks heaps in advance!!

    we're still trying to upload that CLOB. Takes a while over this 2400bps modem ;)

  • Need help with inserting element into a grid

    Hi,
    I'm trying to add an element in a 11x11 grid, but the program stop and give me 2 error (identified in the code) and I have no idea on what is wrong with those line. If anyone have any idea, suggestion or an other way to do this, I could use some help.
    Thx
              for (int i = 0; i != NUMBER; ++i) {
                      int row = 2 + (int)(Math.random() * 10);
                   int col = 2 + (int)(Math.random() * 10);
                   int nb = 0 + (int)(Math.random() * 2);
                   boolean horizontal = true;
                   if (nb == 1)
                        horizontal = false;
                   if (horizontal) {
                        if (row <= element.getDimension()) {  // error at this line
                             for (int j = 0; j != element[i].getDimension(); j++) {
                                  grid[row + j][col]     = "X";
                        else {
                             for (int j = 0; j != element[i].getDimension(); j++) {
                                  grid[row - j][col]     = "X";
                   if (! horizontal) {
                        if (col <= element[i].getDimension()) { // error at this line
                             for (int j = 0; j != element[i].getDimension(); j++) {
                                  grid[row][col + j]     = "X";
                        else {
                             for (int j = 0; j != element[i].getDimension(); j++) {
                                  grid[row][col - j]     = "X";

    My error is : Exception in thread "main" java.lang.NullPointerException
    at Grid.<init><Grid.java:67>
    at PrincTp1.main<PrincTp1.java:24>
    That's my class element
    public class Element {
    // Attributs
         private int dimension;
         private boolean horizontal;
         private String name;
         private int row;
         private int col;
    // Constructor
         public Element(int dimension_, String name_) {
              dimension = dimension_;
              name = name_;
         public Element() {
    // getter/setter
         public void setDimension(int dimension_) {
              dimension = dimension_;
         public int getDimension() {
              return dimension;
         public void setHorizontal(boolean horizontal_) {
              horizontal = horizontal_;
         public boolean getHorizontal() {
              return horizontal;
         public void setNom(String name_) {
              name = name_;
         public String getName() {
              return name;
         public void setLigne(int row_) {
              row = row_;
         public int getRow() {
              return row;
         public void setCol(int col_) {
              col = col_;
         public int getCol() {
              return col;
         }

  • Need Help with my JSF-Project - ResultSet to List to DataTable/c:foreach

    Hello!
    I am struggeling heavily with JSF and JSTL and JSPs...
    I want to show a list of names from a database in my JSF-Document.
    I have the following bean "Category":
    package de.fh_offenburg.audiodb.webapp;
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import java.util.ArrayList;
    import java.util.List;
    import javax.servlet.jsp.jstl.sql.Result;
    public class Category {
         String name = "";
         String creationDate = "";
         int id_kategorie = 0;
         ResultSet resultset;
         Result result;
         Connection con;
         String query = "";
         List result_list;
         Category() {
              result_list = new ArrayList();
              try{
                   con = new ConnectDB().connect();
                   Statement statement = con.createStatement();
                   query = "SELECT * FROM Category WHERE isUKat = '0'";
                   resultset = statement.executeQuery(query);
                   while (resultset.next()) {
                     // Get the data from the row using the column index
                     String name = resultset.getString("name");
                     // create an object for each row (yes, it is hibernate biased) ;-)
                     Cat cat = new Cat();
                     cat.setName(name);
                     cat.setId_kategorie(id_kategorie);
                     // Add the object to the list
                     result_list.add(cat);
              } catch(Exception hcat){
                   System.out.println("HCat-Problem: "+hcat.getMessage());
         public java.lang.String getCreationDate() {
              return creationDate;
         public void setCreationDate(java.lang.String creationDate) {
              this.creationDate = creationDate;
         public int getId_kategorie() {
              return id_kategorie;
         public void setId_kategorie(int id_kategorie) {
              this.id_kategorie = id_kategorie;
         public java.lang.String getName() {
              return name;
         public void setName(java.lang.String name) {
              this.name = name;
         public java.sql.ResultSet getResultset() {
              return resultset;
         public void setResult_cat(java.sql.ResultSet result_cat) {
              this.resultset = result_cat;
         public void setResult(Result result) {
              this.result = result;
         public Result getResult() {
              return result;
         public List getResult_list() {
              return result_list;
         public void setResult_list(ArrayList result_list) {
              this.result_list = result_list;
         }This Bean is registered in my faces-config.xml like this:
    <managed-bean>
      <managed-bean-name>category</managed-bean-name>
      <managed-bean-class>de.fh_offenburg.audiodb.webapp.Category</managed-bean-class>
      <managed-bean-scope>application</managed-bean-scope>
      <managed-property>
       <property-name>creationDate</property-name>
       <property-class>java.lang.String</property-class>
       <value/>
      </managed-property>
      <managed-property>
       <property-name>id_kategorie</property-name>
       <property-class>int</property-class>
       <value/>
      </managed-property>
      <managed-property>
       <property-name>name</property-name>
       <property-class>java.lang.String</property-class>
       <value/>
      </managed-property>
      <managed-property id="result">
       <property-name>result</property-name>
       <property-class>javax.servlet.jsp.jstl.sql.Result</property-class>
       <value/>
      </managed-property>
      <managed-property id="resultset">
       <property-name>resultset</property-name>
       <property-class>java.sql.ResultSet</property-class>
       <value/>
      </managed-property>
      <managed-property id="result_list">
       <property-name>result_list</property-name>
       <property-class>java.util.List</property-class>
       <value/>
      </managed-property>
    </managed-bean>Now I try to read the list of Cats out in my JSF:
                                                      <h:dataTable value="#{category.result_list}" var="result">
                                                           <h:column>
                                                                          <h:outputText value="#{result.name}" />
                                                           </h:column>
                                                      </h:dataTable>... but that doesnt work... I got an error:
    javax.servlet.ServletException: Cannot get value for expression '#{category.result_list}'
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
         org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
         org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
         org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
    root cause So what am I doing wrong?
    I did try to do the same with an JSTL-Syntax (which would be better for me, because I want to layout with DIVs not with a Table...):
                                                      <c:forEach items="#{category.result_list}" var="result">
                                                           <div class="div_mini_kat"><c:out value="#{result.name}"/></div>
                                                      </c:forEach>But that doesnt work out neigther...
    Could someone please tell me what I am doing wrong? I am trying this for days now and I am feeling like a bumble-bee in a glasshouse with one small open doorway which I dont see and thousands of m^2 to crash with...
    Thanks to everyone who answers in advance!!!
    Fuchur

    Hello!
    I am struggeling heavily with JSF and JSTL and JSPs...
    I want to show a list of names from a database in my JSF-Document.
    I have the following bean "Category":
    package de.fh_offenburg.audiodb.webapp;
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import java.util.ArrayList;
    import java.util.List;
    import javax.servlet.jsp.jstl.sql.Result;
    public class Category {
         String name = "";
         String creationDate = "";
         int id_kategorie = 0;
         ResultSet resultset;
         Result result;
         Connection con;
         String query = "";
         List result_list;
         Category() {
              result_list = new ArrayList();
              try{
                   con = new ConnectDB().connect();
                   Statement statement = con.createStatement();
                   query = "SELECT * FROM Category WHERE isUKat = '0'";
                   resultset = statement.executeQuery(query);
                   while (resultset.next()) {
                     // Get the data from the row using the column index
                     String name = resultset.getString("name");
                     // create an object for each row (yes, it is hibernate biased) ;-)
                     Cat cat = new Cat();
                     cat.setName(name);
                     cat.setId_kategorie(id_kategorie);
                     // Add the object to the list
                     result_list.add(cat);
              } catch(Exception hcat){
                   System.out.println("HCat-Problem: "+hcat.getMessage());
         public java.lang.String getCreationDate() {
              return creationDate;
         public void setCreationDate(java.lang.String creationDate) {
              this.creationDate = creationDate;
         public int getId_kategorie() {
              return id_kategorie;
         public void setId_kategorie(int id_kategorie) {
              this.id_kategorie = id_kategorie;
         public java.lang.String getName() {
              return name;
         public void setName(java.lang.String name) {
              this.name = name;
         public java.sql.ResultSet getResultset() {
              return resultset;
         public void setResult_cat(java.sql.ResultSet result_cat) {
              this.resultset = result_cat;
         public void setResult(Result result) {
              this.result = result;
         public Result getResult() {
              return result;
         public List getResult_list() {
              return result_list;
         public void setResult_list(ArrayList result_list) {
              this.result_list = result_list;
         }This Bean is registered in my faces-config.xml like this:
    <managed-bean>
      <managed-bean-name>category</managed-bean-name>
      <managed-bean-class>de.fh_offenburg.audiodb.webapp.Category</managed-bean-class>
      <managed-bean-scope>application</managed-bean-scope>
      <managed-property>
       <property-name>creationDate</property-name>
       <property-class>java.lang.String</property-class>
       <value/>
      </managed-property>
      <managed-property>
       <property-name>id_kategorie</property-name>
       <property-class>int</property-class>
       <value/>
      </managed-property>
      <managed-property>
       <property-name>name</property-name>
       <property-class>java.lang.String</property-class>
       <value/>
      </managed-property>
      <managed-property id="result">
       <property-name>result</property-name>
       <property-class>javax.servlet.jsp.jstl.sql.Result</property-class>
       <value/>
      </managed-property>
      <managed-property id="resultset">
       <property-name>resultset</property-name>
       <property-class>java.sql.ResultSet</property-class>
       <value/>
      </managed-property>
      <managed-property id="result_list">
       <property-name>result_list</property-name>
       <property-class>java.util.List</property-class>
       <value/>
      </managed-property>
    </managed-bean>Now I try to read the list of Cats out in my JSF:
                                                      <h:dataTable value="#{category.result_list}" var="result">
                                                           <h:column>
                                                                          <h:outputText value="#{result.name}" />
                                                           </h:column>
                                                      </h:dataTable>... but that doesnt work... I got an error:
    javax.servlet.ServletException: Cannot get value for expression '#{category.result_list}'
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
         org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
         org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
         org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
    root cause So what am I doing wrong?
    I did try to do the same with an JSTL-Syntax (which would be better for me, because I want to layout with DIVs not with a Table...):
                                                      <c:forEach items="#{category.result_list}" var="result">
                                                           <div class="div_mini_kat"><c:out value="#{result.name}"/></div>
                                                      </c:forEach>But that doesnt work out neigther...
    Could someone please tell me what I am doing wrong? I am trying this for days now and I am feeling like a bumble-bee in a glasshouse with one small open doorway which I dont see and thousands of m^2 to crash with...
    Thanks to everyone who answers in advance!!!
    Fuchur

  • Need Help with INSERTS & INDEXES

    Let me try explaining my scenario and then my confusion:
    Scenario:
    Parent_table
    Child_table
    Both Parent_table & Child_table have Indexes and Constraints.
    Confusion:
    If I remove all Indexes and Constraints, my INSERTS are 10 times faster. Howevere I am taking a chance of:
    1. Loosing Referential Integrity (No Parent row for a Child Row).
    2. Storing Duplicate data.
    The chnaces of either one of this happening is rare, but it is a definite possiblility.
    I am trying to find some articles that will give me some guidance on how this should be done right. Such that I can disable certain Indexes, so that the existing data can be queried without any problems and the new data is Indexed after the load.
    Any help will be appreciated.
    -- Thanks

    Maintaining indexes certainly requires some additional overhead during inserts. Generally, though, you've got indexes in place to allow you to query data at an acceptable speed. Presumably, when you remove all your indexes, all your reporting/ OLTP applications will crawl to a halt.
    What are the indexes you have on these tables and why do those indexes exist? Frequently, you'll find that you may have indexes that are useless either because they are essentially duplicated by other indexes or because they are indexing attributes that don't benefit from having indexes. If 90% of your insert time is being spent updating indexes, that certainly seems like a possibility here...
    Justin

  • Beginner needs help with inserting images in applet.

    //  Name: Sachit Harish
    //  Name of Program: HorseRacing
    //  Date Started: May 15, 2003
    //  Date Finished: 2003
    //  Program Description:
    import java.awt.*;
    import java.applet.*;
    public class HorseRacing extends Applet
    //     Button startGameButton;
         InputField betAmountBox;
         Image redHorse; //<---------//
    //     Button[] drawings = new Button[4];      
    //    String[] labels =  {"Face", "Cheese", "Stick", "Mashed Potatoes"};
        //  Method Name: init()
        //  Parameters Passed: None
        //  Data Returned: None
        //  Method Purpose: Where we initialise the InputBoxes and colors.
        public void init()         
          //     startGameButton=new Button("Click to Start Game");
          //     add(startGameButton);
          /*  for(int i=0; i<drawings.length; i++)
                 drawings=new Button (labels[i]);     
         add(drawings[i]);
    inputBoxes();     
    setBackground(Color.gray); //background color
    setForeground(Color.black); //input field text color
    redHorse = getImage(getCodeBase(), "horse_red.GIF"); //<---------//
    // Method Name: paint()
    // Parameters Passed: Graphics variable screen
    // Data Returned: None
    // Method Purpose: Where the programs calls and collects all the methods.
    //                         If high and low are not integers, an error message
    //                         appears.
    public void paint(Graphics screen)
         //screen.drawString("HORSE RACES!!!!!", 40,60);
         //startGameButton.move(50,300);
         betAmountBox.setPosition(115,200);
         startGame();
         if(betAmountBox.isInt())
              int betAmount=getBetAmount();
         else
    screen.drawString("ERROR: You have not entered an Integer!", 10,110);
    screen.drawString(" Please correct your mistake.", 40,125);
         /*int xPos=10;
         int yPos=10;
         for(int i=0; i<drawings.length; i++)
              drawings[i].move(xPos,yPos);
              xPos+=60;
         screen.drawString("Click each button and get a surprise!", 10,50);*/
    // Method Name: inputBoxes()
    // Parameters Passed: None
    // Data Returned: None
    // Method Purpose: Where we initialise the inputboxes, set the size of
    // the InputField and adds it to the screen. Also
    // initialises the InputField to start with 1's
    void inputBoxes()
    betAmountBox = new InputField(5);
    add(betAmountBox);
    betAmountBox.initialise(50);
    // Method Name: getBetAmount()
    // Parameters Passed: Variable number
    // Data Returned: None
    // Method Purpose: Returns the variable number back to the paint()
    int getBetAmount()
    int betAmount=betAmountBox.toInt();
    return betAmount;
    // Method Name: action()
    // Parameters Passed: Event variable evt, Object varible obj
    // Data Returned: Variable true
    // Method Purpose: This block responds when the user takes an action
    // (such as hitting the return key). It causes the paint
    // block to be done again
    public boolean action(Event evt, Object arg)
    Graphics screen=getGraphics();
    if(evt.target instanceof Button)
         if(arg=="Click to Start Game")
              screen.clearRect(0,0,600,600);
              startGame();
    /*if(evt.target instanceOf Button)
                   if(arg=="Face")
                        screen.clearRect(5,55,400,400);
                        faceDrawing();
                   else if (arg=="Cheese")
                        screen.clearRect(5,55,400,400);
                        cheeseDrawing();
                   else if (arg=="Stick")
                        screen.clearRect(5,55,400,400);
                        stickDrawing();
                   else if (arg=="Mashed Potatoes")
                        screen.clearRect(5,55,400,400);
                        potatoeDrawing();
    return true;
    void startGame()
    Graphics screen=getGraphics();
              //Horse Racing Box
              screen.drawRect(10,10,505,120);
              screen.drawLine(60,10,60,130);
              screen.drawLine(10,40,515,40);
              screen.drawLine(10,70,515,70);
              screen.drawLine(10,100,515,100);               
              screen.setColor(Color.red);
              screen.fillRect(11,11,49,29);
              screen.setColor(Color.yellow);
              screen.fillRect(11,41,49,29);
              screen.setColor(Color.blue);
              screen.fillRect(11,71,49,29);
              screen.setColor(Color.orange);
              screen.fillRect(11,101,49,29);
              screen.setColor(Color.black);
              //Betting Box          
              screen.drawRect(10,150,280,100);     
              screen.drawLine(10,185,290,185);
              screen.drawLine(80,150,80,185);
              screen.drawLine(150,150,150,185);
              screen.drawLine(220,150,220,185);
              screen.setColor(Color.red);
              screen.fillRect(11,151,69,34);
              screen.setColor(Color.yellow);
              screen.fillRect(81,151,69,34);
              screen.setColor(Color.blue);
              screen.fillRect(151,151,69,34);
              screen.setColor(Color.orange);
              screen.fillRect(221,151,69,34);
              screen.setColor(Color.black);
              screen.drawString("BET = ", 40,230);
    screen.drawImage(redHorse, 200,200,300,300,this); //<---------//      
    The picture an't showing up... why? First time trying to insert images. (I made arrows where I did stuff with the image.)
    -sachit

    BTW, ignore the buttons and stuff. I just quickly grabbed this file from an earlier button program. :p
    -sachit

  • Need help with inserting hyperlinks

    I have created a slideshow presentation and the slides are
    all under one presentation. They are only scrolling in the
    presentation field. I have the presentation field separated by
    Keyframes. I ahve 4 keyframes and they all have a picture attached
    to them. This is how I am getting my scroll to work. It is not
    working any other way. The only thing that I need to figure out now
    is how to get the hyperlinks to work. The only way that I can get
    it to go to the link, is by putting goto and the link but that is
    not enabling me to click on the link, it is just opening it when
    the page loads. I need to know how I can get the hyperlinks to work
    when you click and not when you load. I am sure that this is a
    script issue, but I am not sure what I am supposed to type in the
    script to get it to work. I just need some guidance on this. Can
    someone please let me know for one if I am on the right track and
    if not please direct me there too. But most importantly, I need to
    get the hyperlinks working.
    Thanks,
    Katie Kane

    For the images to be clickable, they will have to either be
    Buttons or MovieClips. If your images on the stage are Graphics
    then to easily turn them into MovieClips, select one of them and
    then press the F8 key. Make sure to select MovieClip in the radio
    button list. Once you have turned it into a MovieClip you will have
    to give it an Instance name (see the Properties dialoge box near
    the buttom of the screen in Flash). You will use the Instance name
    to reference this image (now a MovieClip) in ActionScript.
    Assume that you have done the steps above and named your
    movieclip myImage. Then to allow it to be clickable just place the
    following action script on the key frame where the image is
    located:
    myImage.onRelease = function() {
    getURL("
    http://www.adobe.com", "_blank");
    Then when you click on the image it will open a new browser
    window and goto the web address provided.
    Does this help more?
    Tim

  • Need help with merging rows

    Howdy all,
    Given the following data set...
    ID   GROUP_ID   AWESOME   MOD_DATE    LAST_NAME        FIRST_NAME
    52   98              1              2/1/2011       Kirk                    James
    60   99              1              2/2/2011       Kirk                    James
    42   45              0              1/29/2011     Kirk                    James
    100  31             1             6/24/2011      Smurf                 Papa
    200  32             1             6/23/2011      Smurf                 Papa
    300  33             0             6/22/2011      Smurf                 Papa
    400  34             0             6/21/2011     Smurf                  Papa for those with the same last_name and first_name,
    where AWEAOME=0,
    I want to overwrite their GROUP_ID with the grou_ID where AWESOME=1
    and the latest DOM_DATE.
    So for James Kirk, his group_id of 45 will be set the 99
    and for Papa Smurf, his group_ids of 33 and 34 will be set to group_id 31
    Desired result
    ID   GROUP_ID   AWESOME   MOD_DATE    LAST_NAME   FIRST_NAME
    52   98             1              2/1/2011         Kirk              James
    60   99             1              2/2/2011        Kirk              James
    42   99             0             1/29/2011       Kirk              James
    100  31            1             6/24/2011       Smurf             Papa
    200  32            1             6/23/2011      Smurf             Papa
    300  31            0             6/22/2011      Smurf             Papa
    400  31            0             6/21/2011      Smurf             Papa thanks

    Something like
    UPDATE table_name dest
       SET group_id =
        (SELECT group_id
           FROM (
            SELECT group_id,
                   mod_date,
                   first_name,
                   last_name,
                   max( mod_date ) over (partition by last_name, first_name) last_mod_date
               FROM table_name src_inner
              WHERE src_inner.awesome = 1 ) src_outer
          WHERE src_outer.last_mod_date = src_outer.mod_date
            AND src_outer.first_name = dest.first_name
            AND src_outer.last_name = dest.last_name )
    WHERE awesome = 0;should work. This assumes that there is always at least 1 row where AWESOME=1 and the name matches for every row where AWESOME=0. And it assumes there are no duplicates where the same name with AWESOME=1 have the same maximum MOD_DATE.
    Justin

  • Need help with error: No bootable device -- insert boot disk and press any key

    Hello, I need help will my laptop and the error, the message says "no bootable device ", I have tried taking out the hard drive but it still doesn't work. My laptop is a Satillite C55D-A5372. I need help with this; if you know about this ans know how to fix it please reply or email me @ [email protected]
    If needed more clarifications ask me.
    Thank you,
    Jkmano

    if you got into the bios/uefi and have determined that the hdd is being detected then that is good.  At least the hdd is operating to some extent, although still may be corrupt OS or the like.
    Eagle asked you what OS your using (i.e., Windows 8.1 64-bit, Windows 7 32-bit, etc.).  I see that English is not your native language so we'll just have to work with that as best we can. 
    Did you make any changes to the operating system (OS) as a result of the link you posted, and what were they? 
    L305-S5955, T9300 Intel Core 2 Duo, 4GB RAM, 60GB SSD, Win 7 Ultimate 64-bit

Maybe you are looking for

  • Where do i place pictures on my album page?

    I tried to place jpg images onto an album page but they don't show on website. after moving and renaming pics/images -some actually show, and some show as black/white shapes, but none as album photos or slideshow Am I using it the templates wrong?

  • How ca i get help with IOS8 issues.

    Downloaded ios8 on my trusty I Pad 2, 64G, and now it's a mess.  I know this is happening to a multitude of people. My favorite app stopped functioning, Facebook is super slow and crashes, internet is slow, Words with Friends is slow and crashes, the

  • But what if my Consistency Check consistently fails?

    So, I've been trying to clean up my Library in preparation for installing V3.0. Each time I try to run a consistency check, the progress bar makes it about 75% of the way and then . . . . nothing. Ever. Finder does NOT report that Aperture is not res

  • Sorting month Chronologically ( column 1 )

    I have a cross tab report showing "agent performance" by "month", the report is laid out like this                                              April-2010           Feb-2010        Jan-2010 Average handle time Average talk time Everything works as it

  • Root Privileges for oracle user

    Hi, The System Administrator don´t whant that i have the roor password anymore. I need to use root user to do something like commands of RAC (crs_stat, crs_start , crsctl, ...). What option do we have to give the oracle all this privileges without ne