update « mysql « Java Database Q&A

1. Why are batch inserts/updates faster? How do batch updates work?    stackoverflow.com

Why are batch inserts faster? Is it because the connection and setup overhead for inserting a single row is the same for a set of rows? What other factors make batch ...

2. How can I update my MySQL database from a Java applet?    stackoverflow.com

I'm new to Java and I need some advice/information on how to debug my Java Applet. I have created a applet that simply updates a MySQL database. The applet seems to ...

3. single quotes and double quotes in mysql insert and update query (java)    stackoverflow.com

The ComName is 'a'b'c'"def"j Limited. i try to add \ before every ' and " but the resultant query that is executed is

"UPDATE empTable SET empId= '25', ComName = 'a'b'c'"def"j Limited ...

4. Why is it necessary to assign atleast one column in a table (in MySQL) as PRIMARY KEY for the table to accept UPDATE and INSERT statements via JDBC?    stackoverflow.com

Also; can I add a negative INT inside a PRIMARY KEY column inside a table via JDBC?

5. Java: Rollback Database updates?    stackoverflow.com

I have three methods that, together, save a node to the database. Currently, this does not achieve the desired effect of not committing the changes unless all the writes are successful.


6. Connect multiple JCR repositories to one database (and keep updated)    stackoverflow.com

I am a little bit stuck in the moment because I don't know if my problem is solvable at all. I have one database (MySQL) where a JCR repo is stored. Secondly do ...

7. Ways to Actively Update Java from MySQL    stackoverflow.com

What is the best way to update a Java or GWT program from MySQL. For example, a MySQL database which holds Weather information... updating whenever the weather changes a degree. How ...

8. Non-blocking MySQL updates with java?    stackoverflow.com

For a multiplayer game I'm working on I'd like to record events to the mysql database without blocking the game update thread so that if the database is busy or a ...

9. select for update problem in jdbc    stackoverflow.com

I'm having a problem with select for update in jdbc. The table i'm trying to update is the smalldb table, i'm having problems-- i'm using select for update which does a ...

10. Help with java threads or executors: Executing several MySQL selects, inserts and updates simmultaneously    stackoverflow.com

I'm writing an application to analyse a MySQL database, and I need to execute several DMLs simmultaneously; for example:

// In ResultSet rsA: Select * from A;
while (rsA.next()) {

11. Batch Update fails - Rollback operation    stackoverflow.com

I've created a PreparedStatement and have added a couple of data in a bactch

PreparedStatement ps = conn.PreparedStatement("INSERT into table (a, b) values (?, ?)";

ps.setInt(1, 1);
ps.setInt(2, 2);


ps.setInt(1, 4);
ps.setInt(2, 5);

Now when I execute ...

12. MySQL Updates are taking forever    stackoverflow.com

Hey, im trying to wirte about 600000 Tokens into my MySQL Database Table. The Engine I'm using is InnoDB. The update process is taking forever :(. So my best guess is ...

13. Java MySQL Update Query    stackoverflow.com

I am getting the error "cannot issue data". Here is the SSCCE

//package mysqltest;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.Applet;
import java.awt.TextArea.*;
import java.sql.*;
import java.util.*;
import javax.swing.plaf.*;
import javax.swing.plaf.basic.*;
import java.net.*;
import java.applet.*;

    public class test extends JApplet ...

14. SQL replace vs. doing an insert or update statement    stackoverflow.com

I was wondering what the advantages/disadvantages or doing a MySQL replace vs. doing either an update or insert statement are. Basically, doing

instead of:
} else {

15. Hashed passwords updated through JDBC become corrupt. (More of encoding problem than hashing)    stackoverflow.com

I've tried the following with MySQL UTF-8 and Latin-1, to no avail. I hash my passwords (in this case toSecurify) using SHA-1 like so:

  if(toSecurify == null) {

16. MYSQL SELECT ... FOR UPDATE Not working?    stackoverflow.com

I am having issues with MySQL's SELECT .. FOR UPDATE, here is the query I am trying to run:

SQL = "SELECT * " +
      "FROM " ...

17. Optimizing MySQL update query    stackoverflow.com

This is currently my MySQL UPDATE query, which is called from program written in Java:

String query = "UPDATE maxday SET DatePressureREL = (SELECT " + 
   "Date FROM ws3600 ...

18. Incremental update of millions of records    stackoverflow.com

I have a table that contains approx 10 million rows. This table is periodically updated (few times a day) by an external process. The table contains information that, if not in ...

19. Update and read table at the same time?    stackoverflow.com

I have a requirement that I need to update a MySQL table continuously and at the same time read the table for use. Dirty read is acceptable. Is this operation permitted ...

20. Update mysql in Web app    stackoverflow.com

I am having problem updating my mysql in my web application.. I can't Update an Entry. It successfully enters the servlet... but it doesn't update an ENTRY, I suspect it was about ...

21. update mysql database with jdbc    stackoverflow.com

I have an error updating my database because of variables. This is my code:

UPDATE `payment` SET `paid`=1 AND `amoun`=$amountpaid WHERE `paid`=0 AND `userid`=$uid
$amountpaid is the amount of the bill that the ...

22. Problem with prepare statement in java for a mysql update    stackoverflow.com

I have the following string:

public static final String UPDATESONG = "update songs SET " +
        "name = ?, artist = ?, albumName = ?, ...

23. Grails: can I make a validator apply to create only (not update/edit)    stackoverflow.com

I have a domain class that needs to have a date after the day it is created in one of its fields.

class myClass {
  Date startDate
  String iAmGonnaChangeThisInSeveralDays

24. Using Hadoop to update MySQL    stackoverflow.com

I'm using my reducers to input data into MySQL. My concern is that in some cases, multiple reducers are launched for the same key simultaneously. In that case, there is a ...

25. Updating a database record every month    stackoverflow.com

I need to update some user records in my database every month (specifically, give them credits that belong to their subscription), starting the day they sign up. I thought of doing ...

26. MySQL insert on duplicate key update with coalesce() invokes syntax error in java    stackoverflow.com

I'm trying to do an update, saving the old value if the new one is NULL, SQL query is

INSERT INTO scheme (id,type) 
UPDATE scheme 
SET type=COALESCE(1,type) ...

27. Is an open MySQL index query result set a snapshot or does it update in real-time?    stackoverflow.com

Suppose in some program using MySQL ODBC (actually it's Java using JDBC), we have a single thread running with an open MySQL transaction that does this:

  • A ResultSet is opened (but not ...

  • 28. mysql and java (observing updates, creating tables, removing tables and editing information)    stackoverflow.com

    I am working on an application for java right now that will be using a remote mySQL database running on a linux machine. I am wanting to be able to observe ...

    29. Update statement only runs once.?    stackoverflow.com

    So Im having an issue where the results of the first query are only getting updated once.

    Statement statement = con1.createStatement();
        ResultSet qResult = statement.executeQuery("select e.Grade, e.StudentID, s.StudentID, s.Classification, ...

    30. JDBC UPDATE ERROR with MySQL - error code 1054    stackoverflow.com

    this is the code

        PreparedStatement res1 = null;
        String insertUser = "INSERT INTO users (uid,firstname,lastname,score) VALUES (" + 

    31. calling a method on client side on update in database    stackoverflow.com

    I have a database in my sql and I have multiple clients using that database. whenever a column in the database is updated I want to call the corresponding java method on ...

    32. Can not update MySql by Hadoop, only insert    stackoverflow.com

    I'm trying to use Hadoop to read data, process and then write back to MySql. However, it seems as if I can only do insertion. If I try to write back ...

    33. How to know in java about MYSQL updates    stackoverflow.com

    Is it possible to get in Java some events (table was updated or ect) from MySQl. thanks!

    34. Mysql Procedure Containing Both select And Update Statement....How to call such procedure from Java    stackoverflow.com

    I have a table named notification

    id BIGINT PK subject VARCHAR(256) send_to VARCHAR(50) //Email ...

    35. mysql update and insert problem using netbeans    forums.netbeans.org

    hi recently i just started to switch over from MSAccess to MySql. but after i have switch all my data over to MySql, in my Netbeans project i'm able to do ...

    36. Timestamp not updating in mysql    coderanch.com

    37. update query wont work in mysql, column name to blame?    coderanch.com

    Hi All, I am trying to run the following query using mysql : update alerttable set status=4 where status=0 The update does not happen. I am suspecting that it may be because I have the column named "status", is "status" a reserved word ? When I run the query, I do not get an error message, but the rows with status ...

    38. Can you use wildcards in update statements using mysql?    coderanch.com

    Hi All, I am trying to do an update on a mysql table where I have some rows of data that need to be fixed. The data in one column was entered as '01000xxx' and is a String value. I want to change all rows that have a column which begins with '01000' to be '01111'. So, for example, a value ...

    39. Timestamp update not requested in MySQL    coderanch.com

    Hello guys, I had a problem I managed to resolve somehow, but I would like to know if anyone faced this before and if they can explain me what's happening (I solved it, but still can't understand why it happens). Basically, I have a table in which I store topics, each topic has, among the others, fields TOPIC_NUM_VIEWS and TOPIC_DATE (this ...

    40. MySQL table last update    coderanch.com

    41. insert values into MySQL table if not present or update if present    coderanch.com

    Hi, I am doing a project for academic software and I am facing this problem,I want to insert rollno,name,subjectmarks,division ito a table if the values are not present already and if present then I have to update it.I tried the way given below.I am getting values from an excel sheet.But with this code If I press submit then the value if ...

    42. batch updating mysql    coderanch.com

    I have a Container of objects in my server, which regularly need writing to the database. At the moment I simply iterate through the container and do an executeUpdate() for each object. This is slow though. Is there a way I can create an update that will send all the objects to the database in one cumulative update instead of many? ...

    43. MySQL table not updating...    coderanch.com

    I am summarizing a MySQL database. I have a table called Race with 245 columnes and 20,000+ rows. I am adding up the data in the columns and trying to insert that into another table called Race_summary which will have all the same columns but only 1 row. I am attempting to do this somewhat generically so I can reuse the ...

    45. Java mySql update statement    coderanch.com

    46. update arraylist to mysql database    java-forums.org

    47. Updating Mysql Schema table with values from ArrayList    forums.oracle.com

    Are you committing the changes? Is the "machine_id" correct? If performance is at all a aconsideration, you will probably want to use addBatch() and executeBatch() rather than executing each update individually. You might want to think about using Generics (so that the cast to Integer isn't necessary making that line easier to read). You might want to think about using the ...

    48. unable to succesfully execute SQL update statement [JDBC MySQL]    forums.oracle.com

    This code is still wrong (and you shouldn't simply be pasting the "answer" code here anyway). rs will still be closed as soon as rs2 is created. Edit: And, of course, even if you are going to simply be throwing the SQLException, you should still do the rest in a try block with the closing statements in a finally block (there ...

    49. Updating a blob with MySQL?    forums.oracle.com

    50. Problem in update Query of MySQL    forums.oracle.com

    Hi I have a large amounts of records in a teble & i want to update the records in a particular condition but it takes time in updating. I have also used batch update but it's also not going to solve my problem. can anyone help what should i do to frequently update in a large amount of data. I am ...