Answered step by step
Verified Expert Solution
Question
1 Approved Answer
( 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.
|? 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started