
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Consider the following relations for a company • emp (ename, dname, salary) • mgr (ename, mname) and the Java code in Figure 5.20, which uses the JDBC API. Assume that the userid, password, machine name, etc. are all okay. Describe in concise English what the Java |

Transcribed Image Text:import java.sql.*:
public class Mystery {
public static void main(Stringt) args) {
try (
Connection con=DriverManager.getConnection
"jdbc:oracle:thin:star/X@//edgar.cse.lehigh.edu:1521/XE");
q = "select mname from mgr where ename = ?":
Preparedstatement stmt=con.prepareStatement);
String q
String empName = "dog":
boolean more;
ResultSet result;
do {
stmt.setString(1, empName);
result = stmt.executeQuery(q);
more = resultnext();
if (more) {
empName = resultgetstring("mname");
System.outprintin (empName);
} while (more);
s.close();
con.close();
}
catch(Exception e){
e.printstackTrace();
Figure 5.20 Java code for Exercise 5.1 (using Oracle JDBC).
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps

Knowledge Booster
Similar questions
- Can Object-Oriented Programming and Abstract Data Types Coexist? Object-oriented programming and abstract data types are two recent developments. Intentionally, that is. Do you believe there are instances when you just must disagree?arrow_forwardWhat exactly is meant by the term "data structure"? What exactly is meant when one refers to something as having the status of an abstract data type? Would you be able to expound on your response by providing an example?arrow_forwardI need help with this.........arrow_forward
- If you were given the task of defining a Java class MetaDisplay with a method static void print Table(String r), you would create code that accepts the name of a relation as its argument, runs the query "select * from r," and outputs the results as a table with the attribute names in the header. Use the JDBC API function print Table(String r).arrow_forwardThe following java function executes an SQL query based on the inputs from the combo boxes and text box from the screen shown and is supposed to return a list of items that match the query. The input string is a string of the field, operator and criteria text from the boxes separated by commas. However, the method is not currently functional and must be modified to enact the query. Modifiy the function so that it works properly. An image of the database schema has also been attached as well as the product class. public List<Product> getProductByCriteria(String criteria) { if (openConnection()) { try { List<Product> items = new ArrayList<>(); Product temp = null; String[] fields = criteria.split(","); String query = "SELECT * FROM products WHERE " + fields[0] + fields[1] + fields[2]; stmt = conn.prepareStatement(query); ResultSet rs = stmt.executeQuery(); while…arrow_forwardWhat does the term "Abstract Data Type" (ADT) refer to? What are a few advantages of ADTs? How can the idea of heredity facilitate problem-solving?arrow_forward
- Assume you need to store book data in a structured manner. Either more books should be added, or books that are already there should only be removed from one side of the shelf. Choose the best data structure for this case and describe it. Give a dynamic example of how books are added to a shelf. Additionally, what happens when there isn't enough room in a data structure for new data to be added?arrow_forwardWhat is meant by an Abstract Data Type (ADT)? What are the advantages of ADTs? How does the concept of inheritance simplify problem solving?arrow_forwardWhat does the term "Abstract Data Type" (ADT) refer to? What are a few advantages of ADTs? How can the idea of heredity facilitate problem-solving?arrow_forward
- Defintion: What is a data structure? What does it mean to say that something is an abstract data type? Using an example, could you elaborate on your answer?arrow_forwardProgramming Language Pragmatics, 4th Editionarrow_forwardWhat is an Abstract Data Type (ADT) and how does it work? What are the benefits of ADTs, exactly? What are some of the ways that the notion of heredity makes problem solving easier?arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON

Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education

Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY