BUG JSF h:dataTable with JDBC ResultSet - only last column is updated

I tried to create updatable h:dataTable tag with three h:inputText columns with JDBC ResultSet as data source. But what ever I did I have seceded to update only the last column in h:dataTable tag.
My JSF page is:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=windows-1250"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<f:view>
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=windows-1250"/>
<title>Stevan</title>
</head>
<body><h:form>
<p>
<h:messages/>
</p>
<p>
<h:dataTable value="#{tabela.people}" var = "record">
<h:column>
<f:facet name="header">
<h:outputText value="PIN"/>
</f:facet>
<h:inputText value="#{record.PIN}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Surname"/>
</f:facet>
<h:inputText value="#{record.SURNAME}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Name"/>
</f:facet>
<h:inputText value="#{record.NAME}"/>
</h:column>
</h:dataTable>
</p>
<h:commandButton value="Submit"/>
</h:form></body>
</html>
</f:view>
My java been is:
package com.steva;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class tabela {
private Connection conn;
private ResultSet resultSet;
public tabela() throws SQLException, ClassNotFoundException {
Statement stmt;
Class.forName("oracle.jdbc.OracleDriver");
conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe", "hr", "hr");
stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
resultSet = stmt.executeQuery("SELECT PIN, SURNAME, NAME FROM PERSON");
public ResultSet getPeople() {
return resultSet;
I have instaled “Oracle Database 10g Express Edition Release 10.2.0.1.0” – product on my PC localy. I have enabled HR schema and I have instaled and pupulated with sample data folloving table:
CREATE TABLE "PERSON"
(     "PIN" VARCHAR2(20) NOT NULL ENABLE,
     "SURNAME" VARCHAR2(30),
     "NAME" VARCHAR2(30),
     CONSTRAINT "PERSON_PK" PRIMARY KEY ("PIN") ENABLE
I have:
Windows XP SP2
Oracle JDeveloper Studio Edition Version 10.1.3.1.0.3894
I am not shure why this works in that way, but I think that this is a BUG
Thanks in advance.

Hi,
I am sorry because of formatting but while I am entering text looks fine but in preview it is all scrambled. I was looking on the Web for similar problems and I did not find anything similar. Its very simple sample and I could not believe that the problem is in SUN JSF library. I was thinking that problem is in some ResultSet parameter or in some specific Oracle implementation of JDBC thin driver. I did not try this sample on any other platform, database or programming tool. I am new in Java and JSF and I have some experience only with JDeveloper.
Java been(session scope):
package com.steva;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class tabela {
private Connection conn;
private ResultSet resultSet;
public tabela() throws SQLException, ClassNotFoundException {
Statement stmt;
Class.forName("oracle.jdbc.OracleDriver");
conn = DriverManager.getConnection
("jdbc:oracle:thin:@localhost:1521:xe", "hr", "hr");
stmt = conn.createStatement
(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
resultSet = stmt.executeQuery("SELECT PIN, SURNAME, NAME FROM PERSON");
public ResultSet getZaposleni() {
return resultSet;
JSF Page:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=windows-1250"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<f:view>
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=windows-1250"/>
<title>Stevan</title>
</head>
<body><h:form>
<p>
<h:messages/>
</p>
<p>
<h:dataTable value="#{tabela.zaposleni}" var = "record">
<h:column>
<f:facet name="header">
<h:outputText value="PIN"/>
</f:facet>
<h:inputText value="#{record.PIN}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Surname"/>
</f:facet>
<h:inputText value="#{record.SURNAME}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Name"/>
</f:facet>
<h:inputText value="#{record.NAME}"/>
</h:column>
</h:dataTable>
</p>
<h:commandButton value="Submit"/>
</h:form></body>
</html>
</f:view>

Similar Messages

  • Problem with JDBC resultset

    Hello everyone:
    I'm using JDBC to connect to SQL Server, normally after executeQuery();, it should return me a opened BaseResultSet in order that i can read datas by stream(next(), getColumn(),etc...) but sometimes it returns a BaseResultSet closed. (I detected it during the debugging by checking the value of the property "closed" in the object returned ), in this case it refused all the following operations with the exceptions "ResultSet has been closed".
    Does that sound normal? How to solve it ?
    Thanks a lot!!!!

    Did you close the underlying Statement or Connection objects? It might come back empty (e.g., next() returns false), but it should not come back already closed.
    - Saish

  • Does ITunes show updates compatible with your device only or all available updates?

    If iTunes is showing thy iOS 6.1 is available as an update does that mean it's compatible with my device for sure?

    Just the latest signed one that is compatible with your iPhone.

  • Set filter for only one column in tableview

    Hi
    i am using in MVC a htmlb:tableview with filter in only one column of 8.
    This is all working fine, except that the user can enter a searchsting in the filterfield for all columns, but in handle_event (of the controller) ; i only react to a text in the filterfield of column 4 and ignore all other filtertext , which were maybe entered in the other columns.
    My question:
    how can i  enter the filter only for one column, in a way that the user cannot enter any text in the filterfield of the other columns, only in column 4 ?
    my view:
    <htmlb:tableView id             = "requirements"
                     table          = "//model/pdst_reqs"
                     filter         = "APPLICATION"                
                     keyColumn       = "EXTID"
                     iterator        = "<%=model%>"
                     footerVisible   = "FALSE"
                     encode          = "TRUE"
                     visibleRowCount = "<%=model->rowcount%>"
                     width           = "100%"/>
    Best Regards
    Britta

    You can disbale the Filter for the particular column by setting the DISABLE_FILTER in the Iterator method IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS. Here is the sample code
    method IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS .
      CLEAR p_column_definitions.
      CLEAR p_overwrites.
      data tv_column TYPE TABLEVIEWCONTROL.
      tv_column-COLUMNNAME          = 'FLDATE'.
      tv_column-SORT                = 'X'.
      tv_column-EDIT                = 'X'.
      tv_column-ONCELLCLICK         = 'MyCellClick1'.
      tv_column-title               = 'Date '.
      APPEND tv_column TO p_column_definitions.
      CLEAR tv_column.
      tv_column-COLUMNNAME          = 'PRICE'.
      tv_column-horizontalAlignment = 'right'.
      tv_column-verticalAlignment   = 'middle'.
      tv_column-ONCELLCLICK         = 'MyCellClick2'.
      tv_column-title               = 'Currency'. 
      tv_column-EDIT                = 'X'.
      tv_column-DISABLE_FILTER      = 'X'.    " <-------Like this
      APPEND tv_column TO p_column_definitions.
    endmethod.
    Hope this will solve your problem.
    Raja

  • Removing header, border for only single column in mx:DataGrid

    Hi,
        I am using Flex4 SDK and FlashBuilder4.
    I have a requirement where i need to remove column header, borders and grid lines for only last column in datagrid.
    It should look like there is no column present. This column will be used to show some icon for only selected row.
        Can any one suggest how to implement this. Please provide any sample if you can.
    Thanks

    hi Johnny, it was helpfull for me.
    With the given example i am still getting the grid line gaps with the selected row or hover color between verticle cells of the column.
    As gridlines can only be removed for complete datagrid not for a single column. is it possible ?
    Thanks

  • Refurbished Gen5 touch, battery only lasting 12 hours of music on low is this normal?

    Apple store refurbished Touch Gen 5 touch with new iOS only lasting 12 hours of music play on low, in airplane mode turned on. Is this normal? Or do I need to charge than fully discharge afew times. Thank-you for any assistance.

    That is a little low. Was the screen on during that time?
    Was wifi on?
    The following included actions to maximize battery life.
    Apple - Batteries - iPod
    What life do you get after fully charging and almost fully discharging a couple of times.

  • How to create dynamic DataTable with dynamic header/column in JSF?

    Hello everyone,
    I am having problem of programmatically create multiple DataTables which have different number of column? In my JSF page, I should implement a navigation table and a data table. The navigation table displays the links of all tables in the database so that the data table will load the data when the user click any link in navigation table. I have gone through [BalusC's post|http://balusc.blogspot.com/2006/06/using-datatables.html#PopulateDynamicDatatable] and I found that the section "populate dynamic datatable" does show me some hints. In his code,
    // Iterate over columns.
            for (int i = 0; i < dynamicList.get(0).size(); i++) {
                // Create <h:column>.
                HtmlColumn column = new HtmlColumn();
                dynamicDataTable.getChildren().add(column);
                // Create <h:outputText value="dynamicHeaders"> for <f:facet name="header"> of column.
    HtmlOutputText header = new HtmlOutputText();
    header.setValue(dynamicHeaders[i]);
    column.setHeader(header);
    // Create <h:outputText value="#{dynamicItem[" + i + "]}"> for the body of column.
    HtmlOutputText output = new HtmlOutputText();
    output.setValueExpression("value",
    createValueExpression("#{dynamicItem[" + i + "]}", String.class));
    column.getChildren().add(output);
    public HtmlPanelGroup getDynamicDataTableGroup() {
    // This will be called once in the first RESTORE VIEW phase.
    if (dynamicDataTableGroup == null) {
    loadDynamicList(); // Preload dynamic list.
    populateDynamicDataTable(); // Populate editable datatable.
    return dynamicDataTableGroup;
    I suppose the Getter method is only called once when the JSF page is loaded for the first time. By calling this Getter, columns are dynamically added to the table. However in my particular case, the dynamic list is not known until the user choose to view a table. That means I can not call loadDynamicList() in the Getter method. Subsequently, I can not execute the for loop in method "populateDynamicDataTable()".
    So, how can I implement a real dynamic datatable with dynamic columns, or in other words, a dynamic table that can load data from different data tables (different number of columns) in the database at run-time?
    Many thanks for any help in advance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    flyeminent wrote:
    However in my particular case, the dynamic list is not known until the user choose to view a table. Then move the call from the getter to the bean's action method.

  • How can I validate a DataTable with inputText and other JSF components?

    I have a DataTable with various input components. I need to be able to validate what the user has entered on all the rows of the DataTable. Does anyone have any examples they can point me to, experiences with this, or knowledge on how to do this?
    Thank you so much.

    Do you have to use backing beans instead of managed beans to validate components inside a DataTable?

  • Weird JDBC - Works only for 6 ResultSets - Extremely Urgent !!!

    Hey there ! This is seriously an urgent issue .
    I can get succesful results for only 6 columns.
    When I attempt to get another Column( anything > 6),I obtain java.lang.ArrayIndexOutOfBoundsException error.
    DB :- Oracle 8.7
    JDBC :- CLASSPATH=%JAVA_HOME%\lib\tools.jar;
    C:\Program Files\Apache Tomcat 4.0\lib\classes12.zip;
         C:\Program Files\Apache Tomcat 4.0\lib\ojdbc14_g.jar;
    C:\Program Files\Apache Tomcat 4.0\lib\ocrs12.zip;
    Please help, guru`s !!!
    Attached is my code :-
    innerRset = statement.executeQuery("SELECT HBR_TEST_END_TIME,HBR_LOT_NUMBER,HBR_TEST_HEAD,HBR_DUT_SITE, HBR_BIN1, HBR_BIN2, HBR_BIN3 FROM TRDB_HBR WHERE HBR_TEST_END_TIME =TO_DATE('" + newDate +"', 'yyyy-mm-dd HH24:mi:ss')");
              while (innerRset.next())
              String[] columnsHBR = new String[6];
              columnsHBR[0] = innerRset.getString(1);
              columnsHBR[1] = innerRset.getString(2);
         columnsHBR[2] = innerRset.getString(3);
              columnsHBR[3] = innerRset.getString(4);
              columnsHBR[4] = innerRset.getString(5);
         columnsHBR[5] = innerRset.getString(6); //Works fine till here !
              columnsHBR[6] = innerRset.getString(7);// Generates the error if I try the 7th`
              vector.add(columnsHBR);
              /* Print HBR Results */
              Enumeration enum3 = vector.elements();
              while (enum3.hasMoreElements())
              System.out.println("Printing Vector Results");
              String[] columns3 = (String[]) enum3.nextElement();
              out.println(columns3[0] + columns3[1] + columns3[2] + columns3[3] + columns3[4] + columns3[5] + "<BR>\n");
    } // close HBR

    Okay !
    The error of java.lang.ArrayIndexOutOfBoundsException is Not there anymore !
    NOW, I can print more than 7 columns of values.
    BUT, it prints only to Console.
    I try printing to browser, it does NOT display.
    Console output :-
    Printing HBR Results
    T5696810052000-09-09 04:54:00.02000-09-08 19:38:35.0VN8AS32B30May200 SC5
    04062CFNR2 T569681005 J27F<BR>
    Printing HBR Results
    T5696810052000-09-09 10:37:49.02000-09-09 10:37:44.0CX8AS32B30May200 SC5
    04062CFNR2 T569681005 J27F<BR>
    Printing HBR Results
    T5696810052000-09-09 15:02:32.02000-09-09 10:37:44.0CX8AS32B30May200 SC5
    04062CFNR2 T569681005 J27F<BR>
    Printing HBR Results
    T5696810052000-09-09 15:04:09.02000-09-09 10:37:44.0CX8AS32B30May200 SC5
    04062CFNR2 T569681005 J27F<BR>
    Printing HBR Results
    Code :-
    /* Start of TRDB HBR query */
    System.out.println("I am gonna execute Query HBR");
              innerRset = statement.executeQuery("SELECT HBR_TEST_END_TIME, HBR_LOT_NUMBER, HBR_TEST_HEAD, HBR_DUT_SITE, HBR_BIN1, HBR_BIN2, HBR_BIN3 FROM TRDB_HBR WHERE HBR_TEST_END_TIME =TO_DATE('" + newDate +"', 'yyyy-mm-dd HH24:mi:ss')");
              //Query is SELECT HBR_TEST_END_TIME, HBR_LOT_NUMBER, HBR_TEST_HEAD, HBR_DUT_SITE, HBR_BIN1, HBR_BIN2, HBR_BIN3, HBR_BIN4, HBR_BIN5, HBR_BIN6, HBR_BIN7, HBR_BIN8 FROM TRDB_HBR WHERE HBR_TEST_END_TIME =TO_DATE('" + newDate +"', 'yyyy-mm-dd HH24:mi:ss')");
              while (innerRset.next())
              System.out.println("I am in innerRset of HBR");
              String[] columnsHBR = new String[13];
              columnsHBR[0] = innerRset.getString(1);
              columnsHBR[1] = innerRset.getString(2);
         columnsHBR[2] = innerRset.getString(3);
              columnsHBR[3] = innerRset.getString(4);
              columnsHBR[4] = innerRset.getString(5);
         columnsHBR[5] = innerRset.getString(6);
              columnsHBR[6] = innerRset.getString(7);
              //columnsHBR[7] = innerRset.getString(8);
              //columnsHBR[8] = innerRset.getString(9);
              //columnsHBR[9] = innerRset.getString(10);
              //columnsHBR[10] = innerRset.getString(11);
              //columnsHBR[11] = innerRset.getString(12);
              vector.add(columnsHBR);
              // Check No. of Rows in Vector
              int z = (vector).size();
              out.println("<BR>*******************************Element Position in HBR Array =" + z+"******************<BR>");
              /* Print HBR Results */
              Enumeration enum3 = vector.elements();
              while (enum3.hasMoreElements())
         System.out.println("Printing HBR Results");
              String[] columns3 = (String[]) enum3.nextElement();
         //HERE IS THE PROBLEM !!!!!!!!!!!!!!!!!!
              out.println(" HBR results are as follows :- " + columns3[0] + columns3[1] + columns3[2] + columns3[3] + columns3[4] + columns3[5] + columns3[6] +"<BR>\n");
         //PROBLEM ENDS HERE !!!!!!!!!!!!!!!!!!
              System.out.println(" I am Printing HBR Results ");
    System.out.println("Finish printing HBR Results");
    } // close HBR
    outerRset.close();
    innerRset.close();
    /* End of TRDB HBR query */

  • Bug : Datatable with disabled checkboxes

    Hello,
    I was able to implement a datatable with modify, delete links for each row.
    The following code works:
    <h:data_table id="DataTable" value="#{DataScreen.records}" var="record">
      <h:column>
         <f:facet name="header"><h:output_text value=" " /></f:facet>
         <h:command_link action="#{DataScreen.modifyAction}">
           <h:output_text value="#{DataScreen.modifyLabel" />
         </h:command_link>
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value=" " /></f:facet>
         <h:command_link action="#{DataScreen.deleteAction}">
           <h:output_text value="#{DataScreen.deleteLabel" />
         </h:command_link>
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value="Column1_Header" /></f:facet>
         <h:output_text value="#{DataScreen.column1}" />
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value="Column2_Header" /></f:facet>
         <h:output_text value="#{DataScreen.column2}" />
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
    </h:data_table>But, I added a third column of type boolean, which is displayed as a disabled checkbox.
    The table is displayed properly in the browser. But, when I click on the modify, delete links,
    the corresponding action method (DataScreen.modifyAction() or DataScreen.deleteAction())
    is not called.
    <h:data_table id="DataTable" value="#{DataScreen.records}" var="record">
      <h:column>
         <f:facet name="header"><h:output_text value=" " /></f:facet>
         <h:command_link action="#{DataScreen.modifyAction}">
           <h:output_text value="#{DataScreen.modifyLabel" />
         </h:command_link>
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value=" " /></f:facet>
         <h:command_link action="#{DataScreen.deleteAction}">
           <h:output_text value="#{DataScreen.deleteLabel" />
         </h:command_link>
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value="Column1_Header" /></f:facet>
         <h:output_text value="#{DataScreen.column1}" />
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value="Column2_Header" /></f:facet>
         <h:output_text value="#{DataScreen.column2}" />
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
      <h:column>
         <f:facet name="header"><h:output_text value="Column3_Header" /></f:facet>
         <h:selectboolean_checkbox value="#{DataScreen.column3}" disabled="true" />
         <f:facet name="footer"><h:output_text value=" " /></f:facet>
      </h:column>
    </h:data_table>I would be glad to know if there is any workaround.
    Thanks,
    Ajay

    I forgot to mention that there is no error message in the log file. The same page is displayed again
    after clicking on the Modify or Delete Link.
    If I remove the third column (disabled checkbox), the modify and delete links work fine.

  • Problem with JDBC and Tomcat

    I don't know where the problem originate, the only thing in my memory is that the program worked very well on my PC yesterday, but today, without even slightest change, it doesn't work anymore. As to debug it, I simplified the codes to the least, but it still refuse to work. I was beaten down by this problem totally, and cannot make out any solution for it, so, I come here, hoping to find a warrior to kill this damned bug for me.
    My program is a Servlet, but for the purpose of debugging, I have recode it to an Application/Servlet. When run as a application, I can get the result expected, but as a Servlet, :-(, maybe you should see it by yourself. My server software is Tomcat 4.1.15, and the JDK version is 1.4.0. To excute this program, you should add Data Source "Test" to ODBC.
    ///////////////////////code begins/////////////////////////
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    public class Ex extends HttpServlet
         int ErrorType = 0;
         String err = new String("");
         public static void main(String args[]) throws Exception{
              Ex cEx = new Ex();
              cEx.init();     
              System.out.println(cEx.ErrorType);     
         public void init() {
              String url = "jdbc:odbc:Test";
              ErrorType = 3;     //passed
              try{
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              } catch (ClassNotFoundException e) {
                   e.printStackTrace();
                   ErrorType = 1; //trapped in Class.forName
              try{
                   Connection c = DriverManager.getConnection(url);
              } catch (SQLException e) {
                   e.printStackTrace();
                   ErrorType = 2; //trapped in DriverManager.getConnection
                   err = e.getMessage();
         public void service(HttpServletRequest req, HttpServletResponse res)
                   throws IOException {
              res.setContentType("text/html; charset=GB2312");
              PrintWriter out = res.getWriter();
              out.println("Success " + "<p>" + ErrorType + "<p>" +err);
              out.close();
    //////////////////////////code ends///////////////////////////////
    The result from the Servlet tell me that the problem occurred within the connection process, I don't know who should be responsible to this - Tomcat or JDBC?

    If you could print the exception that you got then that would help :) In the mean time, I could make a guess. It is unlikely that your application server (in this case, Tomcat) is blocking connections from your servlet. So the problem is either with JDBC directly or with the underlying datasource. It seems unlikely that it is JDBC given that you have stated that the code has not changed and it works in application form.
    My guess would be that you are coming up against some sort of security constraint (eg: your DBMS is letting you log in from one IP but not another?, your Java plug-in security policy is disallowing the connection?). It's hard to say.
    But if it works as an application but not via a servlet then you could try putting this in your java.policy file, which is located in the directory where your plug-ins are installed (eg: "C:\Program Files\Java\<version>\lib\security\") on Windows systems;
    permission java.net.SocketPermission "bend xp:1099", "listen,connect,accept";
    Try that, see if it works :)
    Ben

  • Problem with jdbc:odbc returning incorrect number of rows.

    Hello,
    Am sure i have done something stupid, but i have an issue with jdbc:odbc ....
    It is a simple sceanrio that i have coded umpteen times before ...
    I have the following ....
    1. Connection to DB2 on an IBM i5 (I apologise for not using native drivers from jt400.jar, but i had an ODBC code example and was in a rush - no excuse i know)
    2. Statement object created from connection above
    3. A string with my SQL in it
    4. A result set for the results.
    These are created as follows:
    Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver");
    con = DriverManager.getConnection(ODBCSource, userID, password);
    if (con == null) {
    // error handling not relevant here
    } else {
    Statement s = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
    String SQL = "select * from table";
    ResultSet rs = s.executeQuery(SQL);
    i then try to loop ....
    while (rs.next() )
    // stuff
    however, i only ever get one result .... if i stick in the check for isLast, the first loop hits this check, i get my little status message, and the loop ends.
    while (rs.next() )
    if (rs.isLast() )
    System.out.println("I am on last record");
    BUT if i run the SQL
    "select count(*) from table" ... i get a count of 148 !!
    I tried setting the FetchSize through setFetchSize(), but made no difference.
    This is running on a JBoss server 4.2.1GA, JDK is "jdk1.6.0_02" .... i have a suspicion that this may be a JBoss specfic issue, as this exact code runs just fine on the Domino platform that it was originally on, if this is the case, i apologise for wasting everyones time .... but would still appreciate any pointers you can give me.
    Cheers

    Hello,
    Thanks for the reply, I am not sure i follow what you are saying.
    I only mentioned JBoss as it is the application server that we have deployed to and because the orignal code ran fine on a Domino server, I will take your advice and try to run it through in debug rather than running actually on the application server.
    Am i incorrect in my assumption that if "select count(*) from table" gives a count of 148, i should expect 148 records in a result set created from "select * from table" ? This is all rather new to me so i apologise if this is incorrect, I'd love to know why this is incorrect so i dont make similar mistakes in future.
    Also, If i run this same code on the previous platform, i get 148 iterations of the code contained within
    while (rs.next() ) { ... }
    When the war file is deployed to JBoss, the same SQL statement gives a result set that only iterates once for
    while (rs.next() ) { ... }
    The previous platform as I say was domino, but it was running as a lotus notes java agent (despite not using any notes documents etc) as it happened to be where the web pages that call this process were located. It is possible that some of the main code has changed as I had cut and paste the code into a servlet using MyEclipse, but i have double checked the bit that does this SQL request and it is identical
    To complete the picture, the new servelt is then called from the action tag on the submit form on a JSP, when it ends the servlet redirects via the requestdispacher to success or failure jsp pages depending on the outcome of the processing.
    Thank you again for your help.

  • Trouble to connect to Oracle Lite with JDBC

    Hi.
    I have installed Oracle Lite 9i on my PC (Win 2000 Pro). Then I connected an HP Jornada 525 (WinCE 3.0) and with
    ActiveSync I installed the Oracle Mobile Client. Using MSql, I created some tables and did some data inserts - Oracle
    is working fine on the Pocket PC. The next step was to create an Java application that will run on the Jornada to
    connect to this database and edit its data. Here is the initial source code:
    import java.sql.*;
    public class JDBCEX {
    public void JDBCEX () {
    public static void main(String args[]) {
    Connection conn = null;
    Statement stmt = null;
    ResultSet retset = null;
    try {
    Class.forName("oracle.lite.poljdbc.POLJDBCDriver");
    conn = DriverManager.getConnection("jdbc:Polite:Polite","system", "manager");
    catch (Exception e) {
    System.out.println(e);
    System.exit(0);
    This works fine on my PC, but in the Pocket PC it gave me: java.sql.SQLException: Internal Error. This after I expanded
    the jar files, 'cause before it tells me that ther is no oljdbc40 on the shared library path. I adjusted the classpath on the
    registry, but i does not have any impact ... There is no file with name oljdbc40, only JARs olite40 and olitejdbc40. I installed
    olitejdbcpj40.jar, and setting this library leads to the same error above.
    What could be wrong? Do you have any tutorial or can you list all steps necessary to bring this working?
    Thanks

    If you're attempting to use the ODBC API directly, have you downloaded the ODBC SDK from Microsoft? That will include some sample code, which is a great starting point. So far as I'm aware, you shouldn't need to configure anything in Borland C++ that you don't have to configure in any other C++ compiler to use ODBC.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • JSF table component with paging

    Are you aware of any existing JSF table component with both navigation and paging ?
    I want to display the content of a database table with a large number of rows. The table component should be able to navigate through the entire table content, but building only a small ResultSet and dinamically populate it with data as we perform navigation.
    Thanks,
    Cosmin

    Thanks for the answer.
    But data scroller just takes a ResultSet and display it with navigation. It doesn't know about the total number of rows in the table. It only display the number of records in the ResultSet.
    What I am looking for is a data scroller which based on some input parameters knows how to split the table in several ResultSets, dinamically change the ResultSet and display the total number of rows in the table and not in the current ResultSet.

  • JSF 1.2 with WAS 6.1

    Our current environment
    WAS 6.1.0.9 and using jsf 1.1
    Is it possible to upgrade to JSF 1.2 with upgrading to WAS 7 ?
    Thanks

    WAS7 already ships with JSF 1.2. JSF 1.2 is supposed to be backwards compatible with JSF 1.1 without any pains. Only keep in mind that any fixed bugs in JSF 1.2 may cause your application to behave different as opposed to JSF 1.1, especially when the application is developed so that it -either awarely or unawarely- relies on the presence of those bugs.

Maybe you are looking for

  • Can No longer see my shortcuts bar in my home scre...

    Help! I have a Nokia 5800 and its suddenly gone bonkers. i'm meant to have a shortcuts bar and the top of my home screen...but its gone. ive obviously been into settings > personal > home screen > home screen theme to shortcuts bar..and all the inbet

  • Why does iPhoto change the sort order of the photos in my album when I attempt to share via Photo Stream?

    Why does iPhoto change the sort order of the photos in my album when I attempt to share via Photo Stream?

  • Sales order conversion

    Hi all, i am uploading sales order using BAPI_SALESORDER_CREATEFROMDAT2, how to upload the address related data for one time shipto customers in the sales orders using this bapi. thanks, deepthi n

  • Project Specific Authorization

    Hi Everyone, My requirement is to implement Project specific Authorization means I want to restrict users to access other projects running in the same plant..Suppose there are four projects A, B, C and D..now there will be four project managers and f

  • My Apple Mail program is stuttering

    My mail program is driving me crazy ... I can only type a few words and then it stalls ... if I continue typing, nothing shows on the screen for 3 or 4 seconds, then it all shows up at once, but a few words later it stalls again. If I finish typing a