Results 1 to 6 of 6
  1. #1
    diamonddragon is offline Senior Member
    Join Date
    Jan 2012
    Posts
    210
    Rep Power
    3

    Default CachedRowSet wont update data source

    While experimenting with CachedRowSet object, I got this error message, when try to update data source:

    This is code that I use for this purpose:
    XML Code:
    String cn = crs.getString("COF_NAME");
                    if (cn.equals("Colombian")) {
                        crs.updateFloat("PRICE", 888);      
                        crs.updateRow();                    
                        crs.acceptChanges();
                    }
    And this is error message:
    XML Code:
    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that
    corresponds to your MySQL server version for the right syntax to use near '.coffees WHERE COF_NAME = 'Colombian' AND SUP_ID = 101
    AND PRICE = 777.00 AND SA' at line 1
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    	at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
    	at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
    	at com.mysql.jdbc.Util.getInstance(Util.java:386)
    	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)
    	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609)
    	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541)
    	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2002)
    	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2163)
    	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2624)
    	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2127)
    	at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2293)
    	at com.sun.rowset.internal.CachedRowSetWriter.updateOriginalRow(CachedRowSetWriter.java:517)
    	at com.sun.rowset.internal.CachedRowSetWriter.writeData(CachedRowSetWriter.java:361)
    	at com.sun.rowset.CachedRowSetImpl.acceptChanges(CachedRowSetImpl.java:880)
    	at package1.ViewTable.getRowSet(ViewTable.java:232)
    	at package1.ViewTable.main(ViewTable.java:247)
    javax.sql.rowset.spi.SyncProviderException: 9conflicts while synchronizing
    Any idea why this happened?

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: CachedRowSet wont update data source

    Just might be related to this reported bug: MySQL Bugs: #43571: Driver attempts to perform SHOW FULL COLUMNS on a non-existent temporary table.

    You could try the suggestion near the bottom of that page (if for nothing else, then to assure yourself it's NOT related to the bug)

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    diamonddragon is offline Senior Member
    Join Date
    Jan 2012
    Posts
    210
    Rep Power
    3

    Default Re: CachedRowSet wont update data source

    I'v tried to use url like suggested:
    "jdbc:mysql://localhost:3306/test?"+"useDynamicCharsetInfo=false"

    but no help.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,442
    Rep Power
    18

    Default Re: CachedRowSet wont update data source

    What's the query used to populate the CRS?

  5. #5
    diamonddragon is offline Senior Member
    Join Date
    Jan 2012
    Posts
    210
    Rep Power
    3

    Default Re: CachedRowSet wont update data source

    Quote Originally Posted by Tolls View Post
    What's the query used to populate the CRS?
    Here:
    Java Code:
    crs.setCommand("select * from test.coffees");

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,442
    Rep Power
    18

    Default Re: CachedRowSet wont update data source

    Wonder what the actual UPDATE SQL is that has been generated.
    Pity MySQL doesn't print the whole thing.

Similar Threads

  1. Replies: 3
    Last Post: 01-16-2012, 11:12 AM
  2. panel wont update when repaint is called
    By yemista in forum AWT / Swing
    Replies: 3
    Last Post: 10-25-2011, 06:58 PM
  3. to log the very fast data source
    By jerry_nf in forum Threads and Synchronization
    Replies: 3
    Last Post: 03-26-2011, 05:21 AM
  4. Update JTable data
    By DC200 in forum AWT / Swing
    Replies: 8
    Last Post: 03-30-2010, 10:10 PM
  5. Sorting CachedRowset
    By Sayed in forum Advanced Java
    Replies: 0
    Last Post: 07-18-2008, 12:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •