JFrame With Two JTables Accessing Database;  Last Table Partial Display

I have an application that calls a JFrame in a database application. The JFrame contains a number of panels, two of which are dedicated to JTables.
The first JTable,upon completion of a resultset, displays master records for the application. Immediately upon completion, the second JTable should be displaying details related to the selected master (on first retrieval, the second Jtable should reflect details related to the first displayed record in the first JTable).
The first JTable displays correctly. The second only displays one record, even though thru inserted System.out.println statements, I can track the number of rows that should be there.
The first JTable fills and then calls a function filldetl(). This is the code:
+
private void filldetl() {
try
details.setRowCount(0);
Statement t = conn.createStatement();
ResultSet dt; // for look up
dt = t.executeQuery("select sku,skuqty,skuunit,value," +
"skucurrency,skuorigin,htc from rcvrdtl " +
"WHERE invoiceno = '" + +invno< </em>
"' ORDER BY invoiceno;");
dd = dt.getMetaData();
*int< </strong>columnct = dd.getColumnCount();
System.+out+.println("Columns found = " + String.+valueOf+(columnct));
// Set up variable dbrowcount to find number of rows in resultset.
int dbrowcount = 0;
while *true*==dt.next()) {
dbrowcount++;
rowx = *new< </strong>Vector(columnct);
datax = new Vector();
for *int< </strong>x = 1; x <= columnct; x++) {
rowx.addElement(dt.getObject(x));
datax.addElement(rowx);
int rowNumx = dt.getRow();
System.+out+.println("Rows Found = " + String.+valueOf+(dbrowcount));
System.+out+.println("Located At Row " + String.+valueOf+(rowNumx));
for *int< </strong>x = 0; x < datax.size(); x++) {
details.addRow((Vector)datax.elementAt(x));
jTable1.revalidate();
jTable1.setRowSelectionInterval(0,0);
catch (Exception et) {
System.+out+.println(et.getMessage());
et.printStackTrace();
+
Can anyone tell me why I am only getting one record displayed in the second JTable, even though there are more? the variable dbrowcount keeps track of how many detail records there should be. And I have verified the counts by checking records in the database.
What am I doing wrong?
Any help appreciated....
Thanks
VazCro

This is the code as it should be. I don't know why it was trashed:
     private void filldetl() {
          try {
               details.setRowCount(0);
               Statement t = conn.createStatement();
               ResultSet dt; // for look up
               dt = t.executeQuery("select sku,skuqty,skuunit,value," +
                         "skucurrency,skuorigin,htc from rcvrdtl " +
                    "WHERE invoiceno = '" + invno +
                    "' ORDER BY invoiceno;");     
               dd = dt.getMetaData();
               int columnct = dd.getColumnCount();
               System.out.println("Columns found = " + String.valueOf(columnct));
               // Set up variable dbrowcount to find number of rows in resultset.
               int dbrowcount = 0;
               while (true==dt.next()) {
                    dbrowcount++;                
                    rowx = new Vector(columnct);
                    datax = new Vector();
                    for (int x = 1; x <= columnct; x++) {
                         rowx.addElement(dt.getObject(x));
                    datax.addElement(rowx);
               int rowNumx = dt.getRow();
               System.out.println("Rows Found = " + String.valueOf(dbrowcount));
               System.out.println("Located At Row " + String.valueOf(rowNumx));
               for (int x = 0; x < datax.size(); x++) {
                    details.addRow((Vector)datax.elementAt(x));
          jTable1.revalidate();
               jTable1.setRowSelectionInterval(0,0);
          catch (Exception et) {
               System.out.println(et.getMessage());
               et.printStackTrace();
I am calculating how many records were found for the second JTable and going thru the routines to load the second JTable. However, only one record appears.
Thanks for your help.
VazCro

Similar Messages

  • Query with the Connector Pack Database Applications Table 9.1.0

    Hi,     
    I have configured with a connector Database Applications Table (OIM-BDSQL2005) specifically to a table, how can enable the user to log into this can be the BD SQL2005
    Thank you

    I had a liitle progress here. For the missing mandatory fields, once you are done the mapping during the creation of GTC, go to Design Console to add mandatory fields, such as user type which is not available in the creation process of GTC. Please see:
    => http://st-curriculum.oracle.com/obe/fmw/oim/10.1.4/oim/obe12_using_gtc_for_reconciliation/using_the_gtc.htm#t5
    Now actually I have exactly the same proplem as this one:
    => Re: Creating GTC in OIM 11g (11.1.1.3.0)
    => Event Recieved
    => Data Validation Succeded
    => No User Match Found
    => Creation Faild
    => Notes: ORA Error Code =>ORA-01400: cannot insert NULL into () ORA Error Stack =>ORA-06512: at DEV_OIM.OIM_SP_RECONBLKUSERCRUD", line 722
    I am looking into this, will keep you posted.
    Ningfeng

  • Uk date format issue with ASP and Access Database

    I have an Asp form which updates records in an Access
    database. Problem is
    that the date format in the database record is dd/mm/yyyy
    (UK), when
    the record is displayed on the form it is mm/dd/yyyy(US)
    which after I
    update the record in the database the date has changed to the
    new format.
    I have tried everything I can to change the format but to no
    avail...anyone any ideas how I can resolve this issue?
    Thanks
    Steve

    stevo.s wrote:
    > Hi
    >
    > I have tried changing the format on the date field on
    the server behaviours
    > panelto ddmmyyy. Also have tried to set the form field
    format to ddmmyy. I have
    > also tried to use a function I got from a posting
    somehwere on the net to no
    > avail. <%function ddmmyyyy(varDate)
    > ddmmyyyy = Day(DateValue(varDate)) & "/" &
    Month(DateValue(varDate))
    > & "/" & Year(DateValue(varDate))
    > end function
    >
    > I believe that this is a recognised issue with
    Dreamweaver and Access but
    > can't seem to grasp the work around! Problem being I am
    teaching myself through
    > books and internet articles and can be weeks at a time
    without being able to
    > look at the issue..each time I come back to it it is
    like starting all over
    > again! I was hoping that somewhere out there there is a
    simple solution the
    > issue perhaps a date picker with the built in
    functionality to address the
    > issue...I am keen to understand how to deal with the
    issue rather than just
    > change my database date field to fudge the problem as I
    am in the UK and when I
    > eventually start to use the application I would like
    there to be some
    > consistency with dates and that users are familiar with
    the format.
    >
    > Any help gratefully received!
    Its not Dreamweaver, or Access, its your servers locale, its
    set to US
    format, not the UK.
    On your page at the top use:
    <% Session.LCID = 2057 %>
    This will force the page into using UK formatted dates. Use
    it on any
    page that needs to format the page correctly.
    Dooza
    Posting Guidelines
    http://www.adobe.com/support/forums/guidelines.html
    How To Ask Smart Questions
    http://www.catb.org/esr/faqs/smart-questions.html

  • urgent insert Date with Time into Access Database

    i found the following codes from the forum to insert date into microsoft access database:
    java.sql.Date date = new java.sql.Date((new java.util.Date()).getTime())
    stmt.executeUpdate("INSERT INTO Testing " +"VALUES (#"+date+"#)");
    but i need to insert the date together with its time so may i know how can i do it?

    thanks alot i works... but it allow only one value to be inserted.
    so i try the codes below:
    Timestamp ts=new Timestamp(tryDate.getTime());
    PreparedStatement p = connection.prepareStatement("insert into testing values(?,?)");
    p.setTimestamp(1,ts);
    p.setString(2,theMsg.getContent());
    p.executeUpdate();
    and error is this:
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Number of query values and destination fields are not the same.
         at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6106)
         at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6263)
         at sun.jdbc.odbc.JdbcOdbc.SQLExecute(JdbcOdbc.java:2564)
         at sun.jdbc.odbc.JdbcOdbcPreparedStatement.execute(JdbcOdbcPreparedStatement.java:214)
         at sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeUpdate(JdbcOdbcPreparedStatement.java:136)
         at DBIncomingQueue.insertMessage(DBIncomingQueue.java:84)
         at DBIncomingQueue.main(DBIncomingQueue.java:213)

  • Refreshing Excel 2010 workbook with connection to Access database on shared network drive

    I have an Excel 2010 workbook that has a connection to an Access database that's on a shared drive on the company network. I can refresh the data in the regular Excel application but when it's hosted in the browser I get this error message "The data
    connection uses Windows Authentication and user credentials could not be delegated."
    Next, I installed PowerPivot for SQL server 2008 and used PowerPivot to connect to the same Access database. I uploaded it to a PowerPivot gallery but when I try to refresh the data but it says "the workbook was created in an older version of Excel
    and PowerPivot and cannot be refreshed until the file is upgraded." I tried to go to "Manage data refresh" but I get the "Sorry, something went wrong" page. Do I need to install PowerPivot for SQL server 2012 to do scheduled data refreshes?
    What about manual refreshes?

    I have an Excel 2010 workbook that has a connection to an Access database that's on a shared drive on the company network. I can refresh the data in the regular Excel application but when it's hosted in the browser I get this error message "The data
    connection uses Windows Authentication and user credentials could not be delegated."
    Next, I installed PowerPivot for SQL server 2008 and used PowerPivot to connect to the same Access database. I uploaded it to a PowerPivot gallery but when I try to refresh the data but it says "the workbook was created in an older version of Excel
    and PowerPivot and cannot be refreshed until the file is upgraded." I tried to go to "Manage data refresh" but I get the "Sorry, something went wrong" page. Do I need to install PowerPivot for SQL server 2012 to do scheduled data refreshes?
    What about manual refreshes?

  • Problem with applications and accessing database

    Hi
    I have a serious problem with my applications.I was trying to change "users"'s folder icon so I changed the setting in information.I don'y know what I did but It made these problems:
    many of applications does not open for example
    itunes-->The folder "iTunes" is on a locked disk or you do not have permission...
    picasa alerts me with a database error
    yahoo messenger just pops up once and doesn't open.
    firefox the same problem
    net monitor alerts with a database problem.
    evernote same problem
    all of my address book is erased.
    I think somehow I removed the db files or I changed the permission and the programs can not access to their db files.

    don't know the last thing I have done was trying to change the icon and after that I found out about the problem.Maybe sth else caused the problem . anyway I copied all of my files to a new user and I removed the user with problems & everything is ok here.thank u all.

  • Linking Access tables, creating a query with using both Access and Oracle

    Hello,
    I am using 3.0.04.34 version Oracle Developer. I am supposed to create a script/procedure to use both Access tables and oracle tables together. There is an option in developer to copy the access tables into oracle. But it doesn't help me. Because when we updated the access tables
    the copied ones are not be updated. How can I created a linked access tables to oracle and create a query with using both access and oracle table together.
    I will appreciate if you guys help me. I look forward to hearing from you guys.
    Thanks,
    Pinar

    Pinar,
    to be able to query MS Access tables in Oracle you need an additional product, the Oracle Database Gateway for ODBC. It allows you to link any foreign database into an Oracle database using a suitable ODBC driver. You can then access the MS Access tables through a database link based on the Database Gateway for ODBC. This will also allow you to join local Oracle and remote MS Access tables from your Oracle database.
    There's a note on My Oracle Support which gives you more details:Document 233876.1 Options for Connecting to Foreign Data Stores and Non-Oracle Databases - For example - DB2, SQL*Server, Sybase, Informix, Teradata, MySQL
    And there's also a dedicated Forum: Heterogeneous Connectivity

  • Forms 6i: working with Microsot access database

    I have developed a form that works with a Microsoft Access database instead of an Oracle database (I use ODBC). The form has a block based in a table named dias and this block has a column named dia based in the column dia.
    When I try to compile this program unit:
    PROCEDURE pru IS
    BEGIN
    select dia from dias;
    END;
    appears the following error: error 201, el identificador dia debe declararse (you have got to declare dia)
    And if I try to compile this:
    PROCEDURE pru IS
    BEGIN
    select dias.dia from dias;
    END;
    appears the following error: error 414,no hay ninguna columna dia en la tabla (there is not any column named dia in the table)
    The :system.last_query variable is "select dia from dias" when I do a query.
    Please, I need your help urgently.
    Thanks,
    Sara

    Try this:
    Properties props = new Properties();
    props.put ("user", user);
    props.put ("password", password);
    props.put ("charSet", "UTF8");
    c = DriverManager.getConnection (url, props);

  • Assining same condtion tables to two diff access sequences

    Hi ,
    Can we use same condition tables with two different Access Sequences. These two different access sequences will be assigned to two different Contion types.
    rgds
    Siddharth

    Hi,
    Now if your multiple condition types are getting satisfied by a single table, then it's up to you can have that table in a single access sequence or multiple.  Ideally it should be through a single access sequence only.
    As stated earlier also, its completely depends on the criteria need to satisfy condition as per your requirement. B'coz there are possibilities where a single condition can be triggered on different criterias, in that case it will required multiple tables. In such scenarios single table may exist in different Access sequences.
    Best way if u are still not satisfied with the response to your query, If I would have been at your case, I would have learned by trail and error.. it will hardly takes time of 1 two 2 hour for creating  new access sequences and test the scenario.
    It's quite possible that words some times don't clear your doubts but when you will try with our guidelines on the system it will surely clear your doubts more appropriately.
    Thank You,
    RB
    Edited by: RB@007 on Dec 10, 2010 8:34 AM

  • VB2005 with Crystal Report XI and MS Access - Database Connector Error:

    Post Author: jvaldeziii
    CA Forum: .NET
    "Database Connector Error:"
    does anybody there whose got an idea with this problem?
    Im using VB2005 and im trying to show a report using CR XI with a Ms Access database...
    Whenever i used a CRAXDRT.Report.SQLQueryString? my application has an error "Database Connector Error"
    but whenever i omit this single line of code CRAXDRT.Report.SQLQueryString?
    crxReport.SQLQueryString = "Select * from tblPersonal where EMP_ID like '0%'"
    Or either i replace it with a CRAXDRT.Report.RecordSelectionFormula?
    crxReport.RecordSelectionFormula = "{tblPersonal.IDNo} like '*'"
    it works fine and it show the report and data...
    But?? i have to use more flexible filter condition like "SQLQueryString" like using LEFT OUTER JOIN or even just a simple query string in sql query...
    but using "SQLQueryString" gives me a head ache to figure it myself... I got this frustrating error in my application... "Database connector error"
    thats why i need help... please anybody has a good idea to resolve this problem "Database connector error" please refer to my code if there's something missing or lacking in my code...
    Here's my sample code:
    Private Sub frmCrystalReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Try
    ChildFormAutoSizeFit(Me)
    Me.Cursor = Cursors.WaitCursor
    Me.MdiParent = frmMain
    crxApp = New CRAXDRT.Application
    crxReport = crxApp.OpenReport(reportPath & "\EmployeeRecord.rpt", CrystalDecisions.Shared.OpenReportMethod.OpenReportByDefault)
    crxDataBase = crxReport.Database
    crxTables = crxDataBase.Tables
    For Each crxTable In crxTables
    crxTable.Location = DataSource
    crxTable.SetLogOnInfo("Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & reportPath, "myEmpDB.mdb", "UserName", "myPassword")
    Next crxTable
    'Note1: this line crxReport.SQLQueryString gives me the headache "Database Connector Error"
    crxReport.SQLQueryString = "Select * from tblPersonal"
    'Note2: this line crxReport.RecordSelectionFormula works fine
    'crxReport.RecordSelectionFormula = "{tblPersonal.IDNo} like '*'"
    AxCRViewer1.ReportSource = crxReport
    AxCRViewer1.ViewReport()
    crxDataBase = Nothing
    crxTable = Nothing
    crxTables = Nothing
    crxReport = Nothing
    crxApp = Nothing
    Catch ex As Exception
    MsgBox(ex.ToString())
    Finally
    Me.Cursor = Cursors.Default
    End Try
    End Sub
    Please anybody there who can resolve this problem or even just a good idea to share?? Please...
    A lot of appreciation to someone or anybody who can help with this... thanks in advance....

    Post Author: Argan
    CA Forum: .NET
    You may want to move/ask this question in the "Other" sdk forum since this is not the CR.NET SDK, but actually RDC/COM SDK.
    You are using the RDC in .NET, which is unsupported/untested so there is no way to know if it is a .NET specific issue or an issue with the RDC.
    One of the COM folks may be of more help in that forum.
    Good luck with your project.

  • Exception connecting to MS Access Database.

    I'm having problems using the jdbc-odbc bridge with an MS Access database and a file DSN. If I use a system DSN, it works fine but it does not seem to find the file DSN for some reason (And I HAVE to use a file DSN in this instance, for reasons I won't bore you with) - this is the error-message:
    "java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"
    This is my example code:
    import java.sql.*;
    public class SamplePgm {
    private static Connection con;
    private static Statement stmt;
    private static ResultSet result;
    public static void main(String[] args) {
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con = DriverManager.getConnection("jdbc:odbc:Testing", "", "");
    stmt = conn.createStatement();
    result = stmt.executeQuery("select TOP 3 emp_no from employee");
    while (result.next()) {
    System.out.println(result.getString("emp_no"));
    } catch (Exception e) {
    e.printStackTrace();
    } finally {
    try {
    result.close();
    stmt.close();
    con.close();
    } catch (SQLException e) {
    e.printStackTrace();
    The file DSN was set up using the Win2K ODBC administrator.
    Is there any other way to tell ODBC that it's using a file DSN ?
    I'd be very grateful for any/all assistance.
    Thanks.

    My guess would be that a file DSN is stored in a file, a system DSN is stored under the HKeyLocalMachine registry key and a user DSN is stored under the HKeyCurrentUser registry key, but it's only a guess.

  • Problem accessing database from JApplet

    Hi all,
    I am having trouble in changing my application to Japplet. It displaying the frame in web page but when i am trying to access database it is not displaying anything. Please let me know if any one know the solution. Thank you.
    bestpro.

    It is hard to say since you didn't post any exceptions you are getting but I would venture to guess you are getting a security exception and you need to sign your applet so your applet can play outside of the security sandbox and connect to your db server.
    Hit google and search for "signing applets" or something similiar and it should put you on the right path.

  • SWAP COLUMNS AND ROW IN AN INTERNAL TABLE to display in ALV

    Hi ,
    I want to swap all the rows in an internal table with the column of the internal table to display it horizontally in ALV grid.
    e.g
    1     2   3  (field names)
    A    P   X
    B    Q   Y
    C    R    Z
    should look like :
    D       A   B     C
    E      P   Q    R
    F       X    Y    Z
    Where D , E, F in first column is already apended in new table.
    Or else is there a way to rotate the ALV grid so that it can display rows as columns & columns as rows.
    regards

    hi,
    i have an internal table which is like
    f1  f2 f3  f4 (column header)
    A  1  2   3
    B  4  5   6
    C  7  8   9
    the values in o/p table should be
    A B C  ( column header)
    1  4 7 
    2  5 8
    3  6 9
    Please help!!

  • For All Entries with two tables

    Hi All,
             Can we use FOR ALL ENTRIES with two tables. for example
    SELECT * FROM MKPF INTO TABLE T_MKPF
             WHERE BUDAT IN S_BUDAT.
    SELECT * FROM MARA INTO TABLE T_MARA
             WHERE MTART IN S_MTART AND
                            MAKTL IN S_MAKTL.
    SELECT * FROM MSEG INTO TABLE T_MSEG
           FOR ALL ENTRIES IN  "T_MKPF AND T_MARA"
                  WHERE MBLNR EQ T_MKPF-MBLNR AND
                                 MATNR EQ T_MARA-MATNR.
    can we do it like this or any other way to do this plz tell. I waitting for your responce.
    Thanks
    Jitendra

    Hi,
    u cannot do like this....chek some documentation on it..
    1. duplicate rows are automatically removed
    2. if the itab used in the clause is empty , all the rows in the source table will be selected .
    3. performance degradation when using the clause on big tables.
    Say for example you have the following abap code:
    Select * from mara
    For all entries in itab
    Where matnr = itab-matnr.
    If the actual source of the material list (represented here by itab) is actually another database table, like:
    select matnr from mseg
    into corresponding fields of table itab
    where ….
    Then you could have used one sql statement that joins both tables.
    Select t1.*
    From mara t1, mseg t2
    Where t1.matnr = t2.matnr
    And T2…..
    So what are the drawbacks of using the "for all entires" instead of a join ?
    At run time , in order to fulfill the "for all entries " request, the abap engine will generate several sql statements (for detailed information on this refer to note 48230). Regardless of which method the engine uses (union all, "or" or "in" predicates) If the itab is bigger then a few records, the abap engine will break the itab into parts, and rerun an sql statement several times in a loop. This rerun of the same sql statement , each time with different host values, is a source of resource waste because it may lead to re-reading of data pages.
    returing to the above example , lets say that our itab contains 500 records and that the abap engine will be forced to run the following sql statement 50 times with a list of 10 values each time.
    Select * from mara
    Where matnr in ( ...)
    Db2 will be able to perform this sql statement cheaply all 50 times, using one of sap standard indexes that contain the matnr column. But in actuality, if you consider the wider picture (all 50 executions of the statement), you will see that some of the data pages, especially the root and middle-tire index pages have been re-read each execution.
    Even though db2 has mechanisms like buffer pools and sequential detection to try to minimize the i/o cost of such cases, those mechanisms can only minimize the actual i/o operations , not the cpu cost of re-reading them once they are in memory. Had you coded the join, db2 would have known that you actually need 500 rows from mara, it would have been able to use other access methods, and potentially consume less getpages i/o and cpu.
    In other words , when you use the "for all entries " clause instead of coding a join , you are depriving the database of important information needed to select the best access path for your application. Moreover, you are depriving your DBA of the same vital information. When the DBA monitors & tunes the system, he (or she) is less likely to recognize this kind of resource waste. The DBA will see a simple statement that uses an index , he is less likely to realize that this statement is executed in a loop unnecessarily.
    Beore using the "for all entries" clause and to evaluate the use of database views as a means to:
    a. simplify sql
    b. simplify abap code
    c. get around open sql limitations.
    check the links
    http://www.thespot4sap.com/articles/SAPABAPPerformanceTuning_ForAllEntries.asp
    The specified item was not found.
    Regards,
    Nagaraj

  • Writing a table to a MS Access database from Powershell

    Hey guys, me again...I'm trying to wrap up a project here and i have a powershell app writing to a SQL database just fine. The last piece is writing to a MS Access database table. For the life of me i cannot find anything out there that really points me
    in the right direction.
    I know my database name/path and i know the table/headers i need to write my data too.
    Anyone have a link to a quick dirty tutorial or can someone point me in the right direction ?
    Thanks as always
    Rich
    Rich Thompson

    I get no error message. I created a blank database with a table called dbo_so_shprimg_pvs and headers
    called so_hdr_key, so_ship_key, imgfileName, so_shprimg_crtdt. I'm doing a test write-host
    prior so i know my variables are good. 
    Rich
    Rich Thompson

Maybe you are looking for

  • How can I add my HP Photosmart C4180 to my home network so that I can print from any of my computers

    I am trying to set up my HP C4180 to my home network so that I can print from any of my computers without having to have them attached by USB. The YouTube video I watched was for a different HP printer and the installation of my HP C4180 did not give

  • External table -Spanish

    I have an external table as described below. One record of the csv has these values: 104,Referencia de reclamación,ES. But when I query the table, TP_DESC, here are the values I get: 1,Referencia de reclamaci�S, null. How do I get it to display the S

  • Possible Problem with quicktime causing itunes malfunction

    i think the problem with my itunes is that the quicktime file is screwed up. i tried removing it on add/remove programs, but it doesnt work for some reason. any possible ways to fix this problem? i also tried downloading quicktime separately, but tha

  • EJB/8i deployment and SSL

    Hello JDev Team, I want to use SSL encryption and authentication in my InfoSwing BC4J Oracle8i application. For Local Deployment it's quite transparent you just define appropriate LocalConnection class and SSL works fine. But for EJB/8i Deployment it

  • Sliding Panel Content Not Hidden

    Hi All. This is my first post so apologies if I do something wrong. I'm setting up sliding panels to work on my site (I've used them before) and this time I can't get the panels that aren't displayed to hide. The panels slide, but all panels are visa