199k views
4 votes
Suppose we have a JDBC Connection object c to a database, and this database has a relation R (name, address, phone) Columns name and address are of string type, while phone is an integer. The following objects are also declare: Statement s-null; q = "SELECT address, phone FROM R" + "WHERE name = 'Bill Gates' ". ng Resultset r null; There are many methods that could be applied to the given variables. Whena method is applied to r, assume that it holds the result of query q. Then, identify a correct use of a method from the list below. oa) r s.executeQuery (q)i b) r-executeQuery(q) O) c) string a = r.ge t String (0); d) String x - r.getInt(1);

User Bilobatum
by
4.6k points

1 Answer

5 votes

Answer:

The correct answer is option A r s.executeQuery (q) ;

Step-by-step explanation:

Solution

The execute Query() method is a method or technique derived from Statement class object. this type of method or techniques implements or executes the SQL query and returns the table in the way of Result Set object.

The Option B, C, and the D in this case is not correct.

User PMerlet
by
4.8k points