Question: ( Batch update ) Write a program that inserts a thousand records to a database, and compare the performance with and without batch updates, as

(Batch update) Write a program that inserts a thousand records to a database, and compare the performance with and without batch updates, as shown in Figure 35.5a. Suppose the table is defined as follows:

create table Temp(num1 double, num2 double, num3 double)

Use the Math.random() method to generate random numbers for each record.

use nanoTime to analize the perfomance of each one of them, batch update and non batch update.

(Batch update) Write a program that inserts a thousand records to a

|? Connect to DB Connected to jdbc:mysql://localhost/javaboolk Exercise35 01 Batch updatc succccdcd Conncct to Databasc DBC Drive com.mysql.jdbc. Driver Database URL jdbc:mysql://localhost/javabook Username cott Password Batch update completed The elapsed time is 174981 Non-Batch update completed The elapsed time is 4981 Connect to DB Batch Update Non-Batch Update dose Dialog

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!