Please help - AbstractTableModel, result set and JTable

Pls help me on this:
I derive a new class, myTable that extends the AbstractTableModel, one of the member method is like this:
public void setValueAt( Object data, int row, int col ){
try{
resultSet.absolute( row + 1 );
resultSet.updateDouble( col + 1, Double.parseDouble( data.toString()));
resultSet.updateRow();
}//end try
catch( SQLException sqlEx ){
JOptionPane.showMessageDialog( null, "SQL error", "", 1 );
Everytime i try to update the data( which is double), example 2.00, i will see this runtime error:
java.lang.NumberFormatError: 2.00
The database is Microsoft Access 2000 and OS is Win ME. I update the data by using JTable GUI( which extends the new class myTable).
When i try to use Oracle database, then there is no problem for this.
How to solve this problem?

can i get a look at your TableModel for the JTable.
Your problem with Access: Access "double" is not the same as
Oracle's double.
you can try the various types that have decimals until you find
which one access will accept.

Similar Messages

  • Please help - Scrollable result set in sql server 2000

    Hi can some one please help me. I'm trying to create scrollable result set in sql server 2000, but i just can't get it to work. I've been trying to do this for the past 12 hours. I want to go home, but I can't till I get this going! please help!!! My crap code is as follows:
    package transact;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.JInternalFrame;
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    public class DummyFrame extends Dummy
    protected String name, surname;
    protected Connection conn;
    protected CallableStatement cstatement;
    public DummyFrame()
    createFrame();
    private void createFrame()
    try
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    conn = DriverManager.getConnection(
    "jdbc:microsoft:sqlserver://server:1433;" +
    "user=user;password=pwd;DatabaseName=Northwind");
    catch (Exception e)
    e.getMessage();
    populateFields();
    menuAction();
    show();
    private void menuAction()
    btncontacts.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent e)
    getRecords();
    populateFields();
    btncontacts.setText("NEXT");
    btnkeywords.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent e)
    // transaction.getRecords();
    nextRecord();
    populateFields();
    btncontacts.setText("NEXT");
    protected void nextRecord()
    try
    // CallableStatement cstatement = null;
    cstatement = conn.prepareCall(
    "{call Employee_Selection}", ResultSet.TYPE_SCROLL_INSENSITIVE,
    ResultSet.CONCUR_UPDATABLE);
    ResultSet rs = cstatement.executeQuery();
    while (rs.next())
    surname = rs.getString("Lastname");
    cstatement.getMoreResults();
    catch (Exception e)
    e.getMessage();
    protected void getRecords()
    try
    CallableStatement cstatement = null;
    cstatement = conn.prepareCall(
    "{call Employee_Selection}", ResultSet.TYPE_SCROLL_INSENSITIVE,
    ResultSet.CONCUR_UPDATABLE);
    ResultSet rs = cstatement.executeQuery();
    while (rs.next())
    surname = rs.getString("Lastname");
    name = rs.getString("Firstname");
    rs.first();
    // call stored procedure
    catch (Exception e)
    e.getMessage();
    // populate the fields;
    private void populateFields()
    txtfirstname.setText(name);
    txtsurname.setText(surname);
    }

    ummm ok i think the logic in your code is kinda screwy...
    here is what your should be doing.
    create the gui.
    get the resultset...
    have code that looks like this for nextRecord...
    protected void displayNextRecord(){
      // we do not call next here because we already called it last time
      surname = rs.getString("Lastname");
      name = rs.getString("Firstname");
      populateFields();
      if(!rs.next(){
        btncontacts.setEnabled(false);// i'm not sure what btncontacts is but we want to disable next becuase there are no more records...
    // in your intitalization code you need to do this...
    // you old stuff ending with...
    ResultSet rs = cstatement.executeQuery();
    // the new stuff...
    if(rs.first()){
      displayNextRecord();
    }else{
      btncontacts.setEnabled(false);//the result set is empty
    }ok the real problem you are having is that you are trying to display one record at a time but you are scrolling
    through the entire result set using while(rs.next()... what you
    want to do is create the result set once and scroll through
    it one item at a time with your gui.
    the example method i have given displays the data from the current
    row in your gui. then it advances the result set forward one row if possible. this method assumes that the result set will always
    be positioned on a valid row thus the need for calling
    rs.first() before we originally call displayNextRecord()
    well i hope you find this helpful.

  • Help with streaming result sets and prepared statements

    hi all
    I create a callable statement that is capable of streaming.
    statement = myConn2.prepareCall("{call graphProc(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}",java.sql.ResultSet.TYPE_FORWARD_ONLY,
    java.sql.ResultSet.CONCUR_READ_ONLY);
    statementOne.setFetchSize(Integer.MIN_VALUE);
    the class that contains the query is instantiated 6 times the first class streams the results beautifully and then when the second
    rs = DatabaseConnect.statementOne.executeQuery();
    is executed I get the following error
    java.sql.SQLException: Can not use streaming results with multiple result statements
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910)
    at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:1370)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1688)
    at com.mysql.jdbc.Connection.execSQL(Connection.java:3031)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:943)
    at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1049)
    at com.mysql.jdbc.CallableStatement.executeQuery(CallableStatement.java:589)
    the 6 instances are not threaded and the result set is closed before the next query executes is there a solution to this problem it would be greatly appreciated
    thanks a lot
    Brian

    Database resources should have the narrowed scope
    possible. I don't think it's a good idea to use a
    ResultSet in a UI to generate a graph. Load the data
    into an object or data structure inside the method
    that's doing the query and close the ResultSet in a
    finally block. Use the data structure to generate
    the graph.
    It's an example of MVC and layering.
    Ok that is my bad for not elaborating on the finer points sorry, the results are not directly streamed into the graphs from the result set. and are processed in another object and then plotted from there.
    with regards to your statement in the beginning I would like to ask if you think it at least a viable option to create six connections. with that said would you be able to give estimated users using the six connections under full usage.
    just a few thoughts that I want to
    bounce off you if you don't mind. Closing the
    statement would defeat the object of of having a
    callable statement How so? I don't agree with that.
    %again I apologise I assumed that since callable statements inherit from prepared statements that they would have the pre compiled sql statement functionality of prepared statements,well If you consider in the example I'm about to give maybe you will see my point at least with regards to this.
    The statement that I create uses a connection and is created statically at the start of the program, every time I make a call the same statement and thus connection is used, creating a new connection each time takes up time and resources. and as you know every second counts
    thanks for your thoughts
    Brian.

  • Please, help me to set up wireless Internet connection. M...

             Please, help me to set up wireless Internet connection. My router is WRT54GS. I able to get online when computer is wired direct to VPN internet cable.
    First, I can’t open password request screen on http://192.168.1.1. 
    Second, when "Setup wizard" runs step #6 (“Check the router’s status”), the program asks for the password. Default password “admin” is rejected by the program and I can’t install Linksys software. Just in case I already pressed reset switch on the back of the router but to no avail. 
    Third, I don’t find out my Ethernet Adapter Wireless Network Connection and correct router’s IP address using ipconfig/all command after connecting WRT54GS with my computer. Ethernet adapter: DHCP disabled, subnet mask 255.255.255.0, IP address 10.32.132.193, default gate 10.32.132.1.
    Tell me please: what’s the matter?

    Pensive wrote:
             Please, help me to set up wireless Internet connection. My router is WRT54GS. I able to get online when computer is wired direct to VPN internet cable.
    First, I can’t open password request screen on http://192.168.1.1. 
    Second, when "Setup wizard" runs step #6 (“Check the router’s status”), the program asks for the password. Default password “admin” is rejected by the program and I can’t install Linksys software. Just in case I already pressed reset switch on the back of the router but to no avail. 
    Third, I don’t find out my Ethernet Adapter Wireless Network Connection and correct router’s IP address using ipconfig/all command after connecting WRT54GS with my computer. Ethernet adapter: DHCP disabled, subnet mask 255.255.255.0, IP address 10.32.132.193, default gate 10.32.132.1.
    Tell me please: what’s the matter?
    hi pensive ,
     Seems interesting , first do this -  push the reset button on the back of router .
    push it till 30 seconds , unplug the power cable and plug in the power cable back in After completion of 30 seconds.
    then try to log into , 192.168.1.1 again . with the password "admin".
    see if it reply?
    Else -
    strt>cmd>ipconfig /all - post the result ?
    pe@c3
    Message Edited by meteor on 01-09-2008 05:58 AM
    ~~~Nobudy's Perfect , i try To Be So ! Each n every moment of maH LYF , AND I THINK dat wats make Me "Different" From others....~~~

  • How can I use a Lookup task to lookup from my SQL Result set and have a join

    So in my Control Flow, I have an Execute SQL Task which gets my Table result set. I then have a Foreach Loop Container that iterates through the result set and a Data Flow. The first task in the Data Flow is an OLE DB Source SQL Command that retrieves data
    columns associated with my result set. I then do a Derived Column so I can SUBSTRING from one of my data columns and now I want to perform a Lookup to my Application Database.
    How do I code my Lookup task to utilize my SQL Result set variable and match on it? I cannot use the GUI for the Lookup task as my Lookup has to have some JOINS in it.
    Thanks for your review and am hopeful for a reply.

    Can you expand on that? I'm sorry but I am new and a novice to the SSIS world and I want to do this as best I can and as efficiently as I can. Are you saying that Rajen's way suggested above is the way to go?
    A little background....external data from a 3rd party client. I'v staged that external data to a SQL Server staging table. I have to try and match that data up to our database using SSN, DOB, and Gender...and if I can't match that way then I have to try
    and match by Name. I need to make sure that there is only one and only one account for that match. If I cannot match and match one and only one, then I'll create rows on a DataAnomaly Table. If I do match, then I have to check and make sure that there is only
    one and only one Member span for that match. Similarly handle the data anomaly and then check and make sure there is a "Diabetes" claim and similarly handle the DataAnomaly accordingly.
    That's where I'm at. Sooooo are you saying to use Rajen's suggestion? I don't think I can do that because I need multiple SQL tasks and I cannot connect multiple OLE DB Source tasks.
    Any help and suggestions are greatly appreciated.
    Thanks.

  • Why to need close the result set and statement

    why to need close the result set and statement

    It's best to explicitly close every ResultSet, Statement, and Connection in the narrowest scope possible.
    These should be closed in a finally block.
    Since each close() method throws SQLException, each one should be in an individual try/catch block to ensure that a failure to close one won't ruin the chances for all the others.
    You can capture this in one nice utility class, like this:
    package db;
    import java.sql.*;
    import java.util.ArrayList;
    import java.util.Map;
    import java.util.LinkedHashMap;
    import java.util.List;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    * Created by IntelliJ IDEA.
    * User: MD87020
    * Date: Feb 16, 2005
    * Time: 8:42:19 PM
    * To change this template use File | Settings | File Templates.
    public class DatabaseUtils
         * Logger for DatabaseUtils
        private static final Log logger = LogFactory.getLog(DatabaseUtils.class);
        /** Private default ctor to prevent subclassing and instantiation */
        private DatabaseUtils() {}
         * Close a connection
         * @param connection to close
        public static void close(Connection connection)
            try
                if ((connection != null) && !connection.isClosed())
                    connection.close();
            catch (SQLException e)
                logger.error("Could not close connection", e);
         * Close a statement
         * @param statement to close
        public static void close(Statement statement)
            try
                if (statement != null)
                    statement.close();
            catch (SQLException e)
                logger.error("Could not close statement", e);
         * Close a result set
         * @param rs to close
        public static void close(ResultSet rs)
            try
                if (rs != null)
                    rs.close();
            catch (SQLException e)
                logger.error("Could not close result set", e);
         * Close both a connection and statement
         * @param connection to close
         * @param statement to close
        public static void close(Connection connection, Statement statement)
            close(statement);
            close(connection);
         * Close a connection, statement, and result set
         * @param connection to close
         * @param statement to close
         * @param rs to close
        public static void close(Connection connection,
                                 Statement statement,
                                 ResultSet rs)
            close(rs);
            close(statement);
            close(connection);
         * Helper method that maps a ResultSet into a map of columns
         * @param rs ResultSet
         * @return map of lists, one per column, with column name as the key
         * @throws SQLException if the connection fails
        public static final Map toMap(ResultSet rs) throws SQLException
            List wantedColumnNames = getColumnNames(rs);
            return toMap(rs, wantedColumnNames);
         * Helper method that maps a ResultSet into a map of column lists
         * @param rs ResultSet
         * @param wantedColumnNames of columns names to include in the result map
         * @return map of lists, one per column, with column name as the key
         * @throws SQLException if the connection fails
        public static final Map toMap(ResultSet rs, List wantedColumnNames)
            throws SQLException
            // Set up the map of columns
            int numWantedColumns    = wantedColumnNames.size();
            Map columns             = new LinkedHashMap(numWantedColumns);
            for (int i = 0; i < numWantedColumns; ++i)
                List columnValues   = new ArrayList();
                columns.put(wantedColumnNames.get(i), columnValues);
            while (rs.next())
                for (int i = 0; i < numWantedColumns; ++i)
                    String columnName   = (String)wantedColumnNames.get(i);
                    Object value        = rs.getObject(columnName);
                    List columnValues   = (List)columns.get(columnName);
                    columnValues.add(value);
                    columns.put(columnName, columnValues);
            return columns;
         * Helper method that converts a ResultSet into a list of maps, one per row
         * @param rs ResultSet
         * @return list of maps, one per row, with column name as the key
         * @throws SQLException if the connection fails
        public static final List toList(ResultSet rs) throws SQLException
            List wantedColumnNames  = getColumnNames(rs);
            return toList(rs, wantedColumnNames);
         * Helper method that maps a ResultSet into a list of maps, one per row
         * @param rs ResultSet
         * @param wantedColumnNames of columns names to include in the result map
         * @return list of maps, one per column row, with column names as keys
         * @throws SQLException if the connection fails
        public static final List toList(ResultSet rs, List wantedColumnNames)
            throws SQLException
            List rows = new ArrayList();
            int numWantedColumns = wantedColumnNames.size();
            while (rs.next())
                Map row = new LinkedHashMap();
                for (int i = 0; i < numWantedColumns; ++i)
                    String columnName   = (String)wantedColumnNames.get(i);
                    Object value = rs.getObject(columnName);
                    row.put(columnName, value);
                rows.add(row);
            return rows;
          * Return all column names as a list of strings
          * @param rs query result set
          * @return list of column name strings
          * @throws SQLException if the query fails
        public static final List getColumnNames(ResultSet rs) throws SQLException
            ResultSetMetaData meta  = rs.getMetaData();
            int numColumns = meta.getColumnCount();
            List columnNames = new ArrayList(numColumns);
            for (int i = 1; i <= numColumns; ++i)
                columnNames.add(meta.getColumnName(i));
            return columnNames;
    }Anybody who lets the GC or timeouts or sheer luck handle their resource recovery for them is a hack and gets what they deserve.
    Do a search on problems with Oracle cursors being exhausted and learn what the root cause is. That should convince you.
    scsi-boy is 100% correct.
    %

  • Regarding mac os x server 10.6 installation, getting an error" Please inspect your network setting and try again"

    Hi,
    we need your urgent help regarding mac os x server 10.6 installation, actually we are stuck in the installation at the point of Network settings. getting an error " Please inspect your network setting and try again" pls give us a solution of it , would be very thankful.
    MTS

    Well, there isn't much anyone can tell you without more information.
    Clearly the installer is complaining about your proposed network configuration, but without seeing it, or knowing what you expect, it's almost impossible to advise.
    I'd guess that it's some combination of the IP address/subnet mask and router address that's invalid, but without seeing them that's little more than a stab in the dark.

  • I forgot my icloud account and my email how can i recover it please help me icloud maker and icloud password and username holder

    i forgot my icloud account and my email how can i recover it please help me icloud maker and icloud password and username holder

    If you don't know your ID, you can try to find it as explained here: http://support.apple.com/kb/HT5625.  Then you can reset the password as explained here: http://support.apple.com/kb/PH2617.  Of course, you can only do this if it's your ID.

  • Hi there, can anyone please help? Download itunes and it says The Itunes library .itl file is locked, or on a locked disk or you do not have write permission for this file.

    Hi there, can anyone please help? Download itunes and it says The Itunes library .itl file is locked, or on a locked disk or you do not have write permission for this file.

    Holding down the shift key while iTunes is opening. That will bring up the 'choose iTunes library' dialog. Select 'Choose LIbrary' from the choices and navigate to your music folder and iTunes music folder.
    Or refer to this article:
    iTunes for Windows XP: "Disk is locked" or "iTunes folder cannot be found" when installing or opening iTunes
    http://support.apple.com/kb/HT1866

  • Please Help me in Labview and MS Access Database Connective

    Please Help me in LabVIEW and MS Access Database Connective through an example . I am new to LabVIEW .I need simple example that take a data from a table and display it on front panel .
    thanks in advance .

    duplicate post

  • My macbook pro 15inch running on maverick when i try to click on wi-fi says no hardware installed please help i need wifi and and under network staus wi-fi is fail and under network airport is not connected can anybody help the wifi icon has a x and does

    my macbook pro 15inch running on maverick when i try to click on wi-fi says no hardware installed please help i need wifi and and under network staus wi-fi is fail and under network airport is not connected can anybody help the wifi icon has a x and does not even let me turn it on

    Have you attempted to reset the SMC? That would be the first step. Hold the left control, option, shift key and the power button for about 5 seconds and release. Then try to reboot. Might as well reset the PRAM as well. Hold command, option, P, R on start up until the machine restarts. If that doesnt' have any affect we'll have to dig deeper into a potential hardware failure.
    If this method doesn't work, check the webcam that will tell the problem is on the iSight & WiFi cable. If your webcam is ok, then it'll be the WiFi card problem. Hope it can help ;-)
    - xia_us9

  • I am having a problem converting word onto PDF . PDF into word.Please help .I am signed and paid to Feb 2015

    Can someone advise me why I am having this problem

    Always in the past .I have my Word Document on screen and then I go to 
    Publish and it atomatically PDF the doc.
    The same if I have a PDF to convert to word. I have the PDF on screen and 
    to the right of my screen it will say Convert .I press on convert it
    converts to  word
    In a message dated 12/17/2014 10:01:32 A.M. Eastern Standard Time, 
    [email protected] writes:
    I  am having a problem converting word onto PDF . PDF into word.Please help
    .I am signed and paid to Feb 2015
    created by florencejohn (https://forums.adobe.com/people/florencejohn) 
    in  Adobe Acrobat.com Services - View the full  discussion
    (https://forums.adobe.com/message/7023171#7023171)

  • Dear Apple,please help me.the glitch and lags on games made me sad beause i am too love with my 4s. Why iOS 7 really made me sad...please help me.im beg for you.

    Dear Apple,please help me.the glitch and lags on games made me sad beause i am too love with my 4s. Why iOS 7 really made me sad...please help me.im beg for you.

    www.apple.com/feedback/iphone.html
    No one from Apple is listening on these forums.

  • ITune message is asking iPhone restore while I am trying to transfer pictures and video from the iPhone to iTune. Before that, software update is suggested. The display on iPhone is stacked to iTunes connection sign. Please help to save pictures and let i

    While trying to import pictures from iPhone to iTunes, iTunes request to make software update and then  to restore iPhone. I have cancelled the restore to rpotect pictures. The pictures have not been imported yet, but the iPhone display freezed at ITune connection page. Please help me save pictures and use the iPhone as usual. Restarting of the phone did not work so far.
    Ringomon 

    If the device is in recovery mode there is no date on the device to salvage.
    Restore the device.

  • Hi please help! After setting up a new mail account my wifi button has greyed out. I've tried rebooting it ie turning off and on but no joy. I'm a complete technophobe and have no idea what to do next. I can receive emails but am unable to reply. HELP PLS

    Please can someone help a total technophobe?!!! I have recently set up a new mail account and since I've done that my wifi button has greyed out. Not sure what happened as I had help from my daughter. She doesn't think that she did anything wrong as has been an iPhone user since day one!! She's at work now so I'm totally lost. Please help. Many thanks.

    it's' an issue on 4S..... here same problem, even after restore the firmware.... wifi and bt are lost....

Maybe you are looking for

  • The Glossary creates a page per term... how to shorten?

    As I have been writing my book I have been adding terms to the Glossary but I have now tried printing the document for review and found that iBooks Author created a separate page for every term - to me this is not a workable result. Does anyone know

  • Frustration setting in!  G4 iPod skips purchased music (tried reset, etc.)

    Hi All - I've been a Mac guy since System 7. I got the iPod knowing that it would "just work" like all things Mac. I've purchased music through iTunes because it's the right thing to do, but I'm beginning to get frustrated with a problem I'm having p

  • Problems with TableAdapters and Subquerys,

    I want to create a TableAdapter with the next query (For example): SELECT NAME_ROL, FK_ID_APP, DESC_ROL, ( SELECT 'Name of app' FROM DUAL ) NOMBRE_APL FROM AU_ROL I get this error: Error in SELECT clause: expression near 'SELECT'. Error in SELECT cla

  • Report Builder ORA 24333 Zero iteration count

    The following query works fine in SQL environment Break on team_name; select substr(st.team_name, 1, 20) team_name, sst.team_id, sst.staff_sso from ssa_staff_team sst, ssa_teams st where st.team_id = sst.team_id(+) order by team_name; But when I cut

  • CVS management for Numbers?

    Does anyone know why my CVS directories are being blown away when I save .numbers files. I don't get the same problem with other applications like graffle, which also uses directories for files.. The best solution I have found so far is to use OnMyCo