. , - .
Java API- , . ,
theMethod.invoke()
Method theMethod= clazz .getMethod(
"someName", null );
theMethod.invoke(clazzObj, arglist);
, (, wrpaping {clazzObj, theMethod} , , , - .
=== ====
, SQL , .
, JDBC, . .
I see no difference between Java and C # approaches. The example you are referring to has
c.moveToFirst();
recordID = c.getString(c.getColumnIndex("id"));
c.close();
A JDBC tutorial shows code like this
String query = "
SELECT COFFEES.COF_NAME " +
"FROM COFFEES, SUPPLIERS " +
"WHERE SUPPLIERS.SUP_NAME LIKE 'Acme, Inc.' " +
"and SUPPLIERS.SUP_ID = COFFEES.SUP_ID";
ResultSet rs = stmt.executeQuery(query);
System.out.println("Coffees bought from Acme, Inc.: ");
while (rs.next()) {
String coffeeName = rs.getString("COF_NAME");
System.out.println(" " + coffeeName);
}
where do you get coumns by name.
source
share