Questions from Starting Out With Java


Q: Write a method that accepts a StringBuilder object as an argument and

Write a method that accepts a StringBuilder object as an argument and converts all occurrences of the lowercase letter ‘t’ in the object to uppercase.

See Answer

Q: How do you submit a SELECT statement to the DBM?

How do you submit a SELECT statement to the DBM?

See Answer

Q: Where does a ResultSet object’s cursor initially point? How

Where does a ResultSet object’s cursor initially point? How do you move the cursor forward in the result set?

See Answer

Q: When a Java programmer uses a DBMS to store and manipulate data

When a Java programmer uses a DBMS to store and manipulate data, why doesn’t the programmer need to know specific details about the physical structure of the data?

See Answer

Q: Assume that a valid ResultSet object exists, populated with data.

Assume that a valid ResultSet object exists, populated with data. What method do you call to retrieve column 3 as a string? What do you pass as an argument to the method?

See Answer

Q: Write an SQL statement to insert a new row into the Coffee

Write an SQL statement to insert a new row into the Coffee table containing the following data: Description: Eastern Blend ProdNum: 30-001 Price: 18.95

See Answer

Q: Rewrite the following INSERT statement so that it specifies the Coffee tableâ

Rewrite the following INSERT statement so that it specifies the Coffee table’s column names. INSERT INTO Coffee VALUES ('Honduran Dark', '22-001', 8.65)

See Answer

Q: The Midnight Coffee Roastery is running a special on decaf coffee.

The Midnight Coffee Roastery is running a special on decaf coffee. Write an SQL statement that changes the price of all decaf coffees to 4.95.

See Answer

Q: The sale on decaf coffee didn’t do too well,

The sale on decaf coffee didn’t do too well, so the Midnight Coffee Roastery has decided to stop selling decaf. Write an SQL statement that will delete all decaf ­coffees from the Coffee table.

See Answer

Q: Write the SQL statement to create a table named Book. The

Write the SQL statement to create a table named Book. The Book table should have the columns to hold the name of the publisher, the name of the author, the number of pages, and a 10-character ISBN num...

See Answer