Question: Database course 5. Suppose we have a JDBC Connection object c to a database, and this database has a relation R(name, address, phone) Columns name
5. 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 declared: Statement s = null; String q = "SELECT address, phone FROM R" + "WHERE name = 'Bill Gates'". ResultSet r null; There are many methods that could be applied to the given variables. When a 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. 0 a) String x = r.getInt (1); 0 b) r = c. executeQuery (g) ; O c) int p = r.getInt (2); O d) r = s.executeQuery ( )
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
