All Matches
Solution Library
Expert Answer
Textbooks
Search Textbook questions, tutors and Books
Oops, something went wrong!
Change your search query and then try again
Toggle navigation
FREE Trial
S
Books
FREE
Tutors
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Hire a Tutor
AI Study Help
New
Search
Search
Sign In
Register
study help
computer science
starting out with java from control structures
Questions and Answers of
Starting Out With Java From Control Structures
Assume that the following declaration exists. Final String DB_URL = "jdbc:derby:CoffeeDB";The string referenced by DB_URL is a database URL. Write a statement that uses this string to get a
What SQL data types correspond with the following Java types? • Int• Float• String• Double
If you are writing an application to store the customer and inventory records for a large business, why would you not want to use traditional text or binary files?
This is the technology that makes it possible for a Java application to communicate with a DBMS.a. DBMSCb. JDBCc. JDBMSd. JDSQL
Find the error in the following SQL statement. SELECT * FROM Coffee WHERE ProdNum != '14-001'
You hear a fellow classmate say the following: “JDBC is a standard language for working with database management systems. It was invented at IBM.” Are these statements correct, or is he confusing
This is a standard language for working with database management systems.a. Javab. COBOLc. SQLd. BASIC
Find the error in the following Java code. Assume that conn references a valid Connection object.// This code has an error!!!String sql = "SELECT * FROM Coffee";Statement stmt =
When we speak of database organization, we speak of such things as rows, tables, and columns. Describe how the data in a database is organized into these conceptual units.
What are the relational operators in SQL for the following comparisons?Greater-thanLess-thanGreater-than or equal-toLess-than or equal-toEqual-toNot equal-to
Suppose you have a Java DB database on your system named InventoryDB. What database URL would you use in a Java program to get a connection to the database?
This type of SQL statement is used to retrieve rows from a table.a. RETRIEVEb. GETc. SELECTd. READ
This contains the results of an SQL SELECT statement.a. Select setb. Result setc. SQL setd. Collection set
Write a SELECT statement that will return all of the columns from the rows where TradingSymbol starts with “SU”.
What static JDBC method do you call to get a connection to a database?
This clause allows you to specify search criteria with the SELECT statement.a. SEARCHb. WHEREc. ASd. CRITERIA
This is a Java class that is designed to communicate with a specific DBMS.a. JDBC driverb. DBMS Superclassc. DBMS Subclassd. Stream converter
What Java data types correspond with the following SQL types?• INTEGER• INT• REAL• CHAR• CHARACTER• VARCHAR• DOUBLE
This SQL statement is used to delete an entire table.a. REMOVEb. DROPc. PURGEd. DELETE
Find the error in the following SQL statement. SELECT * FROM Coffee WHERE Description = "French Roast Dark"
Write an application that connects to the CoffeeDB database, and allows the user to insert a new row into the Customer table.
Why do most businesses use a DBMS to store their data instead of creating their own text files or binary files to hold the 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?
Make sure you have downloaded the book’s source code from the companion Web site at www.pearsonhighered.com/gaddis. In this chapter’s source code folder you will find a program named
Write an application that connects to the CoffeeDB database, then calculates and displays the total amount owed in unpaid orders. This will be the sum of each row’s Cost column.
What is the technology that makes it possible for a Java application to communicate with a DBMS?
The data that is stored in a table is organized in __________.a. Rowsb. Filesc. Foldersd. Pages
Write an application that connects to the CoffeeDB database and displays a JList component. The JList component should display a list of customers with unpaid orders. When the user clicks on a
What is the standard language for working with database management systems?
The data that is stored in a row is divided into __________.a. Sectionsb. Bytesc. Columnsd. Tables
What is a result set?
What is a database URL?
This is a column that holds a unique value for each row, and can be used to identify specific rows.a. ID columnb. Public keyc. Designator columnd. Primary key
Write a SELECT statement that will return the TradingSymbol column only from the rows where PurchasePrice is greater than 25.00.
Write a GUI application that allows the user to add new employees to the Personnel database you created in Programming Challenge 6. Data in Programming Challenge 6.Write an application that
Write a SELECT statement that will return the TradingSymbol column only from the rows where SellingPrice is greater than PurchasePrice, and NumShares is greater than 100.
What is metadata? What is result set metadata? When is result set metadata useful?
Write a GUI application that allows the user to look up an employee in the Personnel database you created in Programming Challenge 6. The user should be able to change any of the employee’s
Describe how the data that is stored in a table is organized.
Write a SELECT statement that will return the TradingSymbol column and the NumShares column only from the rows where SellingPrice is greater than PurchasePrice, and NumShares is greater than 100. The
Assume that a database has a table named Inventory, with the following columns: a) Write a SELECT statement that will return all of the columns from every row in table.b) Write a SELECT
Write an application that creates a database named PhoneBook. The database should have a table named Entries, with columns for a person’s name and phone number.Next, write an application that lets
This is a string listing the protocol that should be used to access a database, the name of the database, and potentially other items.a. JDBC driverb. JDBC locatorc. Database URLd. Database specifier
Write an SQL statement that will insert a new row into the Stock table. The row should have the following column values: TradingSymbol: XYZCompanyName: “XYZ Company”NumShares:
Write an SQL statement that does the following: For each row in the Stock table, if the TradingSymbol column is “XYZ”, change it to “ABC”.
This method is specified in the Statement interface, and should be used to execute a SELECT statement.a. Executeb. ExecuteUpdatec. ExecuteQueryd. ExecuteSelect
What is a ResultSet object?
This method is specified in the Statement interface, and should be used to execute an UPDATE statement.a. Executeb. ExecuteUpdatec. ExecuteQueryd. ExecuteSelect
Look at the following SQL statement.SELECT Id FROM Account What is the name of the table from which this statement is retrieving data? What is the name of the column that is being retrieved?
This method is specified in the Statement interface, and should be used to execute an INSERT statement.a. Executeb. ExecuteUpdatec. ExecuteQueryd. ExecuteSelect
This SQL statement is used to insert rows into a table.a. INSERTb. ADDc. CREATEd. UPDATE
Assuming that conn references a valid Connection object, write code to create a Statement object. (Do not be concerned about result set scrolling or concurrency.)
What is the purpose of the LIKE operator?
This SQL statement is used to remove rows from a table.a. REMOVEb. ERASEc. PURGEd. DELETE
Look at the following declaration. String sql = "SELECT * FROM Coffee WHERE Price . 10.00";Assume also that stmt references a valid Statement object. Write code that executes the SQL statement
What is the purpose of the % symbol in a character pattern used by the LIKE operator? What is the purpose of the underline (_) character?
Assume that the following code is used to retrieve data from the CoffeeDB database’s Coffee table. Write the code that should appear inside the loop to display the contents of the result set.String
How can you sort the results of a SELECT statement on a specific column?
This is a column in one table that references a primary key in another table.a. Secondary keyb. Fake keyc. Foreign keyd. Duplicate key
Write an SQL statement to create a table named Car. The Car table should have the columns to hold a car’s manufacturer, year model, and a 20-character vehicle ID number.
Assume that the following declarations exist: Final String DB_URL = "jdbc:derby:CoffeeDB";String sql = "SELECT * FROM Coffee";Write code that uses these String objects to get a database
True/False: Java comes with its own built-in DBMS.
How do you submit a SELECT statement to the DBMS?
True/False: A Java programmer that uses a DBMS to store data does not need to know about the physical structure of the data.
Where does a ResultSet object’s cursor initially point? How do you move the cursor forward in the result set?
True/False: You use SQL instead of Java to write entire applications, including the user interface.
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?
True/False: In SQL, the not-equal-to operator is !=, which is the same as in Java.
Write an SQL statement to insert a new row into the Coffee table containing the following data: Description: Eastern BlendProdNum: 30-001Price: 18.95
True/False: When a ResultSet object is initially created, its cursor is pointing at the first row in the result set.
Rewrite the following INSERT statement so that it specifies the Coffee table’s column names.INSERT INTO CoffeeVALUES ('Honduran Dark', '22-001', 8.65)
True/False: In a transaction, it is permissible for only some of the database updates to be made.
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.
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.
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
Write a statement to delete the Book table you created in Checkpoint 17.25. Data in Checkpoint 17.25.Write the SQL statement to create a table named Book. The Book table should have the columns
How do you place a menu bar in a JFrame?
True or False: A JMenu object cannot contain other JMenu objects.
Assume that a class inherits from the JFrame class. Write code that can appear in the class constructor, which gives the content pane a FlowLayout manager. Components added to the content pane should
What happens when the mnemonic that you assign to a component is a letter that appears in the component’s text?
Create an application that calculates the registration fees for a conference. The general conference registration fee is $895 per person, and student registration is $495 per person. There is also an
The ListSelectionListener interface is in this package.a. Java.awtb. Java.awt.eventc. Javax.swing.eventd. Javax.event
A custom window shade designer charges a base fee of $50 per shade. In addition, charges are added for certain styles, sizes, and colors as follows: Styles:Regular shades: Add $0Folding shades:
How do you store an image in a JLabel component? How do you store both an image and text in a JLabel component?
What is a tool tip? What is its purpose?
This JList method returns 21 if no item in the list is selected.a. GetSelectedValueb. GetSelectedItemc. GetSelectedIndexd. GetSelection
How do you store an image in a JButton component? How do you store both an image and text in a JButton component?
Write code that creates a button with the text “Open File.” Assign the O key as a mnemonic and assign “This button opens a file” as the component’s tool tip.
What do you do to a group of radio button menu items so that only one of them can be selected at a time?
A JComboBox component generates this type of event when the user selects an item.a. Action eventb. Item eventc. List selection eventd. List change event
This chapter’s source code folder contains images for a complete deck of poker cards. Write a GUI application, similar to the one shown in Figure 13-34, that randomly selects a card from the deck
You can pass an instance of this class to the JLabel constructor if you want to display an image in the label.a. ImageFileb. ImageIconc. JLabelImaged. JImageFile
What method do you use to store an image in an existing JLabel or JButton component?
Write code that displays a file open dialog box. If the user selects a file, the code should store the file’s path and name in a String variable.
When a checked menu item shows a check mark next to it, what happens when the user clicks on it?
This method can be used to store an image in a JLabel or a JButton component.a. SetImageb. StoreImagec. GetIcond. SetIcon
What is a mnemonic? How do you assign a mnemonic to a component?
What fonts does Java guarantee you have?
This is text that appears in a small box when the user holds the mouse cursor over a component.a. Mnemonicb. Instant messagec. Tool tipd. Pop-up mnemonic
What is a tool tip? How do you assign a tool tip to a component?
Showing 1 - 100
of 1252
1
2
3
4
5
6
7
8
9
10
11
12
13