I am working on JNI program and I am not able to call a java method from my C++ program.
The code snippet of java method is here
public static void getTables(Connection conn) throws Exception {
String TABLE_NAME = "TABLE_NAME";
String TABLE_SCHEMA = "TABLE_SCHEM";
String[] TABLE_TYPES = {"TABLE"};
DatabaseMetaData dbmd = conn.getMetaData();
ResultSet tables = dbmd.getTables(null, null, null, TABLE_TYPES);
while (tables.next()) {
System.out.println(tables.getString(TABLE_NAME));
System.out.println(tables.getString(TABLE_SCHEMA));
}
}
And I want to call this java method from C++ program.
I am able to call the main method for that the code is
midMain = env->GetStaticMethodID(clsH, "main", "([Ljava/lang/String;)V");
I want to call getTables method like this. Please help me to solve it.