Fixed JNI method + SQL queries