Question: Java Question 6 Which statement will set the value John to the first parameter of the PreparedStatement below? String sql = insert into Student (first,

Java

Question 6

Which statement will set the value John to the first parameter of the PreparedStatement below? String sql = insert into Student (first, middle, last) values (?, ?, ?) ; PreparedStatement ps = conn.prepareStaement(sql);

ps.setString(0, John);
ps.setString(0, John);
ps.setString(1, John);
ps.setString(1, John);

Question 7

Which statement is used to execute the query Select * from products using the Statement object stmt?

stmt.executeUpdate(Select * from products);
stmt.exectue(Select * from products);
stmt.exectueQuery(Select * from products);
stmt.query(Select * from products);

Question 8

What statement needs to be included below to retrieve all rows from the Invoices table with InvoiceTotal greater than 100? String sql = "SELECT InvoiceDate, InvoiceTotal " + "FROM Invoices WHERE InvoiceTotal > ?"; PreparedStatement ps = connection.prepareStatement(sql); //what goes here ResultSet invoices = ps.executeQuery();

ps.setValue(0, 100);
ps.setValue(1, 100);
ps.setDouble(0, 100);
ps.setDouble(1, 100);

Question 9

What must you make available to your application before you can use JDBC to connect to a database?

A database driver
A web server
A firewall
An ODBC data source

Question 10

A _____ is a swing GUI component that can be bound to a database to display the results of a query.

TableModel
JTextField
JTable
JQuery

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!