Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribed

|? 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MongoDB Applied Design Patterns Practical Use Cases With The Leading NoSQL Database

Authors: Rick Copeland

1st Edition

1449340040, 978-1449340049

More Books

Students also viewed these Databases questions

Question

Develop a program for effectively managing diversity. page 303

Answered: 1 week ago

Question

List the common methods used in selecting human resources. page 239

Answered: 1 week ago