#include <jni.h>
Include dependency graph for JSqlStatement.h:
Go to the source code of this file.
Functions | |
JNIEXPORT void JNICALL | Java_csql_jdbc_JSqlStatement_alloc (JNIEnv *, jobject, jint) |
JNIEXPORT void JNICALL | Java_csql_jdbc_JSqlStatement_free (JNIEnv *, jobject) |
JNIEXPORT void JNICALL | Java_csql_jdbc_JSqlStatement_setConnectionPtr (JNIEnv *, jobject, jlong) |
JNIEXPORT jint JNICALL | Java_csql_jdbc_JSqlStatement_prepare (JNIEnv *, jobject, jstring) |
JNIEXPORT jboolean JNICALL | Java_csql_jdbc_JSqlStatement_isSelect (JNIEnv *, jobject) |
JNIEXPORT jint JNICALL | Java_csql_jdbc_JSqlStatement_execute (JNIEnv *, jobject) |
JNIEXPORT jlong JNICALL | Java_csql_jdbc_JSqlStatement_next (JNIEnv *, jobject) |
JNIEXPORT jlong JNICALL | Java_csql_jdbc_JSqlStatement_close (JNIEnv *, jobject) |
JNIEXPORT void JNICALL | Java_csql_jdbc_JSqlStatement_setShort (JNIEnv *, jobject, jint, jshort) |
JNIEXPORT void JNICALL | Java_csql_jdbc_JSqlStatement_setInt (JNIEnv *, jobject, jint, jint) |
JNIEXPORT void JNICALL | Java_csql_jdbc_JSqlStatement_setLong (JNIEnv *, jobject, jint, jlong) |
JNIEXPORT void JNICALL | Java_csql_jdbc_JSqlStatement_setByte (JNIEnv *, jobject, jint, jbyte) |
JNIEXPORT void JNICALL | Java_csql_jdbc_JSqlStatement_setFloat (JNIEnv *, jobject, jint, jfloat) |
JNIEXPORT void JNICALL | Java_csql_jdbc_JSqlStatement_setDouble (JNIEnv *, jobject, jint, jdouble) |
JNIEXPORT void JNICALL | Java_csql_jdbc_JSqlStatement_setString (JNIEnv *, jobject, jint, jstring) |
JNIEXPORT void JNICALL | Java_csql_jdbc_JSqlStatement_setDate (JNIEnv *, jobject, jint, jobject) |
JNIEXPORT void JNICALL | Java_csql_jdbc_JSqlStatement_setTime (JNIEnv *, jobject, jint, jobject) |
JNIEXPORT void JNICALL | Java_csql_jdbc_JSqlStatement_setTimestamp (JNIEnv *, jobject, jint, jobject) |
JNIEXPORT void JNICALL | Java_csql_jdbc_JSqlStatement_setNull (JNIEnv *, jobject, jint) |
JNIEXPORT jshort JNICALL | Java_csql_jdbc_JSqlStatement_getShort (JNIEnv *, jobject, jint) |
JNIEXPORT jint JNICALL | Java_csql_jdbc_JSqlStatement_getInt (JNIEnv *, jobject, jint) |
JNIEXPORT jlong JNICALL | Java_csql_jdbc_JSqlStatement_getLong (JNIEnv *, jobject, jint) |
JNIEXPORT jbyte JNICALL | Java_csql_jdbc_JSqlStatement_getByte (JNIEnv *, jobject, jint) |
JNIEXPORT jfloat JNICALL | Java_csql_jdbc_JSqlStatement_getFloat (JNIEnv *, jobject, jint) |
JNIEXPORT jdouble JNICALL | Java_csql_jdbc_JSqlStatement_getDouble (JNIEnv *, jobject, jint) |
JNIEXPORT jstring JNICALL | Java_csql_jdbc_JSqlStatement_getString (JNIEnv *, jobject, jint) |
JNIEXPORT jobject JNICALL | Java_csql_jdbc_JSqlStatement_getDate (JNIEnv *, jobject, jint) |
JNIEXPORT jobject JNICALL | Java_csql_jdbc_JSqlStatement_getTime (JNIEnv *, jobject, jint) |
JNIEXPORT jobject JNICALL | Java_csql_jdbc_JSqlStatement_getTimestamp (JNIEnv *, jobject, jint) |
JNIEXPORT void JNICALL | Java_csql_jdbc_JSqlStatement_freeStmt (JNIEnv *, jobject) |
JNIEXPORT void JNICALL Java_csql_jdbc_JSqlStatement_alloc | ( | JNIEnv * | , | |
jobject | , | |||
jint | ||||
) |
Definition at line 19 of file JSqlStatement.cxx.
References SqlFactory::createStatement(), CSql, CSqlGateway, and stmt.
00020 { 00021 jclass cls; 00022 jfieldID fid; 00023 00024 AbsSqlStatement *stmt; 00025 if (mode ==1 ) 00026 stmt = SqlFactory::createStatement(CSql); 00027 else 00028 stmt = SqlFactory::createStatement(CSqlGateway); 00029 00030 cls = env->GetObjectClass( obj ); 00031 fid = env->GetFieldID( cls, "sqlStmtPtr", "J"); 00032 if (fid == 0) 00033 { 00034 jclass Exception = env->FindClass("java/lang/Exception"); 00035 env->ThrowNew(Exception,"JNI: GetFieldID failed.\n"); 00036 return; 00037 } 00038 env->SetLongField( obj, fid, (jlong) stmt ); 00039 return; 00040 }
Here is the call graph for this function:
JNIEXPORT jlong JNICALL Java_csql_jdbc_JSqlStatement_close | ( | JNIEnv * | , | |
jobject | ||||
) |
Definition at line 220 of file JSqlStatement.cxx.
References AbsSqlStatement::close(), and stmt.
00221 { 00222 //TODO::stmt currently does not support close 00223 jclass cls; 00224 jfieldID fid; 00225 cls = env->GetObjectClass(obj); 00226 fid = env->GetFieldID( cls, "sqlStmtPtr", "J"); 00227 if (fid == 0) 00228 { 00229 jclass Exception = env->FindClass("java/lang/Exception"); 00230 env->ThrowNew(Exception,"JNI: GetFieldID failed.\n"); 00231 return(-1); 00232 } 00233 AbsSqlStatement *stmt = (AbsSqlStatement*) env->GetLongField( obj, fid ); 00234 int rv =0; 00235 rv = stmt->close(); 00236 return rv; 00237 }
Here is the call graph for this function:
JNIEXPORT jint JNICALL Java_csql_jdbc_JSqlStatement_execute | ( | JNIEnv * | , | |
jobject | ||||
) |
Definition at line 171 of file JSqlStatement.cxx.
References AbsSqlStatement::execute(), OK, and stmt.
00172 { 00173 jclass cls; 00174 jfieldID fid; 00175 00176 cls = env->GetObjectClass(obj); 00177 fid = env->GetFieldID( cls, "sqlStmtPtr", "J"); 00178 if (fid == 0) 00179 { 00180 jclass Exception = env->FindClass("java/lang/Exception"); 00181 env->ThrowNew(Exception,"JNI: GetFieldID failed.\n"); 00182 return(-1); 00183 } 00184 AbsSqlStatement *stmt = (AbsSqlStatement*) env->GetLongField( obj, fid ); 00185 int rowsAffected =0; 00186 DbRetVal rv = stmt->execute(rowsAffected); 00187 if (rv != OK) return -1; 00188 return rowsAffected; 00189 }
Here is the call graph for this function:
JNIEXPORT void JNICALL Java_csql_jdbc_JSqlStatement_free | ( | JNIEnv * | , | |
jobject | ||||
) |
Definition at line 48 of file JSqlStatement.cxx.
References stmt.
00049 { 00050 jclass cls; 00051 jfieldID fid; 00052 00053 cls = env->GetObjectClass(obj); 00054 fid = env->GetFieldID( cls, "sqlStmtPtr", "J"); 00055 if (fid == 0) 00056 { 00057 jclass Exception = env->FindClass("java/lang/Exception"); 00058 env->ThrowNew(Exception,"JNI: GetFieldID failed.\n"); 00059 return; 00060 } 00061 AbsSqlStatement *stmt = (AbsSqlStatement*) env->GetLongField( obj, fid ); 00062 delete stmt; 00063 return; 00064 }
JNIEXPORT void JNICALL Java_csql_jdbc_JSqlStatement_freeStmt | ( | JNIEnv * | , | |
jobject | ||||
) |
Definition at line 72 of file JSqlStatement.cxx.
References AbsSqlStatement::free(), and stmt.
00073 { 00074 jclass cls; 00075 jfieldID fid; 00076 00077 cls = env->GetObjectClass(obj); 00078 fid = env->GetFieldID( cls, "sqlStmtPtr", "J"); 00079 if (fid == 0) 00080 { 00081 jclass Exception = env->FindClass("java/lang/Exception"); 00082 env->ThrowNew(Exception,"JNI: GetFieldID failed.\n"); 00083 return; 00084 } 00085 AbsSqlStatement *stmt = (AbsSqlStatement*) env->GetLongField( obj, fid); 00086 stmt->free(); 00087 return; 00088 00089 }
Here is the call graph for this function:
JNIEXPORT jbyte JNICALL Java_csql_jdbc_JSqlStatement_getByte | ( | JNIEnv * | , | |
jobject | , | |||
jint | ||||
) |
Definition at line 645 of file JSqlStatement.cxx.
References AbsSqlStatement::getFieldValuePtr().
00646 { 00647 jclass cls; 00648 jfieldID fid; 00649 00650 cls = env->GetObjectClass( obj ); 00651 fid = env->GetFieldID( cls, "sqlStmtPtr", "J"); 00652 if (fid == 0) 00653 { 00654 jclass Exception = env->FindClass("java/lang/Exception"); 00655 env->ThrowNew(Exception,"JNI: GetFieldID failed.\n"); 00656 return(-1); 00657 } 00658 AbsSqlStatement *sqlStmt = (AbsSqlStatement*) env->GetLongField( obj, fid ); 00659 00660 // Validate pos 00661 // Handle conversion 00662 00663 // Read data at column 00664 void *fvp = sqlStmt->getFieldValuePtr( pos ); 00665 return( * ((char*)fvp) ); 00666 }
Here is the call graph for this function:
JNIEXPORT jobject JNICALL Java_csql_jdbc_JSqlStatement_getDate | ( | JNIEnv * | , | |
jobject | , | |||
jint | ||||
) |
Definition at line 769 of file JSqlStatement.cxx.
References Date::dayOfMonth(), AbsSqlStatement::getFieldValuePtr(), Date::month(), and Date::year().
00770 { 00771 jclass cls; 00772 jfieldID fid; 00773 00774 cls = env->GetObjectClass( obj ); 00775 fid = env->GetFieldID( cls, "sqlStmtPtr", "J"); 00776 if (fid == 0) 00777 { 00778 jclass Exception = env->FindClass("java/lang/Exception"); 00779 env->ThrowNew(Exception,"JNI: GetFieldID failed.\n"); 00780 return( (jobject) 0 ); 00781 } 00782 AbsSqlStatement *sqlStmt = (AbsSqlStatement*) env->GetLongField( obj, fid ); 00783 00784 // Validate pos 00785 // Handle conversion 00786 00787 // Read data at column 00788 void *fvp = sqlStmt->getFieldValuePtr( pos ); 00789 00790 // Create Java Object 00791 jclass cDate = env->FindClass("java/sql/Date"); 00792 jmethodID methodID = env->GetMethodID( cDate, "<init>", "(III)V" ); 00793 jobject dateObj; 00794 00795 Date *dt = (Date*) fvp; 00796 dateObj = env->NewObject( cDate, methodID, 00797 (jint) dt->year()-1900, (jint) dt->month() - 1, 00798 (jint) dt->dayOfMonth() ); 00799 00800 return( dateObj ); 00801 }
Here is the call graph for this function:
JNIEXPORT jdouble JNICALL Java_csql_jdbc_JSqlStatement_getDouble | ( | JNIEnv * | , | |
jobject | , | |||
jint | ||||
) |
Definition at line 703 of file JSqlStatement.cxx.
References AbsSqlStatement::getFieldValuePtr().
00704 { 00705 jclass cls; 00706 jfieldID fid; 00707 00708 cls = env->GetObjectClass( obj ); 00709 fid = env->GetFieldID( cls, "sqlStmtPtr", "J"); 00710 if (fid == 0) 00711 { 00712 jclass Exception = env->FindClass("java/lang/Exception"); 00713 env->ThrowNew(Exception,"JNI: GetFieldID failed.\n"); 00714 return(-1); 00715 } 00716 AbsSqlStatement *sqlStmt = (AbsSqlStatement*) env->GetLongField( obj, fid ); 00717 00718 // Validate pos 00719 // Handle conversion 00720 00721 // Read data at column 00722 void *fvp = sqlStmt->getFieldValuePtr( pos ); 00723 return( * ((double*)fvp) ); 00724 }
Here is the call graph for this function:
JNIEXPORT jfloat JNICALL Java_csql_jdbc_JSqlStatement_getFloat | ( | JNIEnv * | , | |
jobject | , | |||
jint | ||||
) |
Definition at line 674 of file JSqlStatement.cxx.
References AbsSqlStatement::getFieldValuePtr().
00675 { 00676 jclass cls; 00677 jfieldID fid; 00678 00679 cls = env->GetObjectClass( obj ); 00680 fid = env->GetFieldID( cls, "sqlStmtPtr", "J"); 00681 if (fid == 0) 00682 { 00683 jclass Exception = env->FindClass("java/lang/Exception"); 00684 env->ThrowNew(Exception,"JNI: GetFieldID failed.\n"); 00685 return(-1); 00686 } 00687 AbsSqlStatement *sqlStmt = (AbsSqlStatement*) env->GetLongField( obj, fid ); 00688 00689 // Validate pos 00690 // Handle conversion 00691 00692 // Read data at column 00693 void *fvp = sqlStmt->getFieldValuePtr( pos ); 00694 return( * ((float*)fvp) ); 00695 }
Here is the call graph for this function:
JNIEXPORT jint JNICALL Java_csql_jdbc_JSqlStatement_getInt | ( | JNIEnv * | , | |
jobject | , | |||
jint | ||||
) |
Definition at line 587 of file JSqlStatement.cxx.
References AbsSqlStatement::getFieldValuePtr().
00588 { 00589 jclass cls; 00590 jfieldID fid; 00591 00592 cls = env->GetObjectClass( obj ); 00593 fid = env->GetFieldID( cls, "sqlStmtPtr", "J"); 00594 if (fid == 0) 00595 { 00596 jclass Exception = env->FindClass("java/lang/Exception"); 00597 env->ThrowNew(Exception,"JNI: GetFieldID failed.\n"); 00598 return(-1); 00599 } 00600 AbsSqlStatement *sqlStmt = (AbsSqlStatement*) env->GetLongField( obj, fid ); 00601 00602 // Validate pos 00603 // Handle conversion 00604 00605 // Read data at column 00606 void *fvp = sqlStmt->getFieldValuePtr( pos ); 00607 return( * ((int*)fvp) ); 00608 }
Here is the call graph for this function:
JNIEXPORT jlong JNICALL Java_csql_jdbc_JSqlStatement_getLong | ( | JNIEnv * | , | |
jobject | , | |||
jint | ||||
) |
Definition at line 616 of file JSqlStatement.cxx.
References AbsSqlStatement::getFieldValuePtr().
00617 { 00618 jclass cls; 00619 jfieldID fid; 00620 00621 cls = env->GetObjectClass( obj ); 00622 fid = env->GetFieldID( cls, "sqlStmtPtr", "J"); 00623 if (fid == 0) 00624 { 00625 jclass Exception = env->FindClass("java/lang/Exception"); 00626 env->ThrowNew(Exception,"JNI: GetFieldID failed.\n"); 00627 return(-1); 00628 } 00629 AbsSqlStatement *sqlStmt = (AbsSqlStatement*) env->GetLongField( obj, fid ); 00630 00631 // Validate pos 00632 // Handle conversion 00633 00634 // Read data at column 00635 void *fvp = sqlStmt->getFieldValuePtr( pos ); 00636 return( * ((long*)fvp) ); 00637 }
Here is the call graph for this function:
JNIEXPORT jshort JNICALL Java_csql_jdbc_JSqlStatement_getShort | ( | JNIEnv * | , | |
jobject | , | |||
jint | ||||
) |
Definition at line 550 of file JSqlStatement.cxx.
References AbsSqlStatement::getFieldValuePtr().
00551 { 00552 jclass cls; 00553 jfieldID fid; 00554 00555 cls = env->GetObjectClass( obj ); 00556 fid = env->GetFieldID( cls, "sqlStmtPtr", "J"); 00557 if (fid == 0) 00558 { 00559 jclass Exception = env->FindClass("java/lang/Exception"); 00560 env->ThrowNew(Exception,"JNI: GetFieldID failed.\n"); 00561 return(-1); 00562 } 00563 AbsSqlStatement *sqlStmt = (AbsSqlStatement*) env->GetLongField( obj, fid ); 00564 00565 // Validate pos 00566 // Handle conversion 00567 00568 // Read data at column 00569 void *fvp = sqlStmt->getFieldValuePtr( pos ); 00570 return( * ((short*)fvp) ); 00571 }
Here is the call graph for this function:
JNIEXPORT jstring JNICALL Java_csql_jdbc_JSqlStatement_getString | ( | JNIEnv * | , | |
jobject | , | |||
jint | ||||
) |
Definition at line 732 of file JSqlStatement.cxx.
References AbsSqlStatement::getFieldValuePtr().
00733 { 00734 jclass cls; 00735 jfieldID fid; 00736 00737 cls = env->GetObjectClass( obj ); 00738 fid = env->GetFieldID( cls, "sqlStmtPtr", "J"); 00739 if (fid == 0) 00740 { 00741 jclass Exception = env->FindClass("java/lang/Exception"); 00742 env->ThrowNew(Exception,"JNI: GetFieldID failed.\n"); 00743 return( (jstring) 0 ); 00744 } 00745 AbsSqlStatement *sqlStmt = (AbsSqlStatement*) env->GetLongField( obj, fid ); 00746 00747 // Validate pos 00748 // Handle conversion 00749 00750 // Read data at column 00751 void *fvp = sqlStmt->getFieldValuePtr( pos ); 00752 return( env->NewStringUTF( (char*) fvp ) ); 00753 }
Here is the call graph for this function:
JNIEXPORT jobject JNICALL Java_csql_jdbc_JSqlStatement_getTime | ( | JNIEnv * | , | |
jobject | , | |||
jint | ||||
) |
Definition at line 809 of file JSqlStatement.cxx.
References AbsSqlStatement::getFieldValuePtr(), Time::hours(), Time::minutes(), and Time::seconds().
00810 { 00811 jclass cls; 00812 jfieldID fid; 00813 00814 cls = env->GetObjectClass( obj ); 00815 fid = env->GetFieldID( cls, "sqlStmtPtr", "J"); 00816 if (fid == 0) 00817 { 00818 jclass Exception = env->FindClass("java/lang/Exception"); 00819 env->ThrowNew(Exception,"JNI: GetFieldID failed.\n"); 00820 return( (jobject) 0 ); 00821 } 00822 AbsSqlStatement *sqlStmt = (AbsSqlStatement*) env->GetLongField( obj, fid ); 00823 00824 // Validate pos 00825 // Handle conversion 00826 00827 // Read data at column 00828 void *fvp = sqlStmt->getFieldValuePtr( pos ); 00829 00830 // Create Java Object 00831 jclass cTime = env->FindClass("java/sql/Time"); 00832 jmethodID methodID = env->GetMethodID( cTime, "<init>", "(III)V" ); 00833 jobject timeObj; 00834 00835 Time *tm = (Time*) fvp; 00836 timeObj = env->NewObject( cTime, methodID, 00837 (jint) tm->hours(), (jint) tm->minutes(), 00838 (jint) tm->seconds() ); 00839 00840 return( timeObj ); 00841 }
Here is the call graph for this function:
JNIEXPORT jobject JNICALL Java_csql_jdbc_JSqlStatement_getTimestamp | ( | JNIEnv * | , | |
jobject | , | |||
jint | ||||
) |
Definition at line 849 of file JSqlStatement.cxx.
References TimeStamp::dayOfMonth(), AbsSqlStatement::getFieldValuePtr(), TimeStamp::hours(), TimeStamp::minutes(), TimeStamp::month(), TimeStamp::seconds(), and TimeStamp::year().
00850 { 00851 jclass cls; 00852 jfieldID fid; 00853 00854 cls = env->GetObjectClass( obj ); 00855 fid = env->GetFieldID( cls, "sqlStmtPtr", "J"); 00856 if (fid == 0) 00857 { 00858 jclass Exception = env->FindClass("java/lang/Exception"); 00859 env->ThrowNew(Exception,"JNI: GetFieldID failed.\n"); 00860 return( (jobject) 0 ); 00861 } 00862 AbsSqlStatement *sqlStmt = (AbsSqlStatement*) env->GetLongField( obj, fid ); 00863 00864 // Validate pos 00865 // Handle conversion 00866 00867 // Read data at column 00868 void *fvp = sqlStmt->getFieldValuePtr( pos ); 00869 00870 // Create Java Object 00871 jclass cTimestamp = env->FindClass("java/sql/Timestamp"); 00872 jmethodID methodID = env->GetMethodID( cTimestamp, "<init>", "(IIIIIII)V" ); 00873 jobject timeObj; 00874 00875 TimeStamp *ts = (TimeStamp*) fvp; 00876 timeObj = env->NewObject( cTimestamp, methodID, \ 00877 (jint) ts->year()-1900, (jint) ts->month() - 1, (jint) ts->dayOfMonth(), \ 00878 (jint) ts->hours(), (jint) ts->minutes(), (jint) ts->seconds(), (jint) 0 ); 00879 00880 return( timeObj ); 00881 }
Here is the call graph for this function:
JNIEXPORT jboolean JNICALL Java_csql_jdbc_JSqlStatement_isSelect | ( | JNIEnv * | , | |
jobject | ||||
) |
Definition at line 148 of file JSqlStatement.cxx.
References AbsSqlStatement::isSelect().
00149 { 00150 jclass cls; 00151 jfieldID fid; 00152 00153 cls = env->GetObjectClass(obj); 00154 fid = env->GetFieldID( cls, "sqlStmtPtr", "J"); 00155 if (fid == 0) 00156 { 00157 jclass Exception = env->FindClass("java/lang/Exception"); 00158 env->ThrowNew(Exception,"JNI: GetFieldID failed.\n"); 00159 return(-1); 00160 } 00161 AbsSqlStatement *s = (AbsSqlStatement*) env->GetLongField( obj, fid ); 00162 return s->isSelect(); 00163 }
Here is the call graph for this function:
JNIEXPORT jlong JNICALL Java_csql_jdbc_JSqlStatement_next | ( | JNIEnv * | , | |
jobject | ||||
) |
Definition at line 197 of file JSqlStatement.cxx.
References AbsSqlStatement::next(), and stmt.
00198 { 00199 jclass cls; 00200 jfieldID fid; 00201 cls = env->GetObjectClass(obj); 00202 fid = env->GetFieldID( cls, "sqlStmtPtr", "J"); 00203 if (fid == 0) 00204 { 00205 jclass Exception = env->FindClass("java/lang/Exception"); 00206 env->ThrowNew(Exception,"JNI: GetFieldID failed.\n"); 00207 return(-1); 00208 } 00209 AbsSqlStatement *stmt = (AbsSqlStatement*) env->GetLongField( obj, fid ); 00210 void *tuple = stmt->next(); 00211 if (NULL == tuple) return 0; else return 1; 00212 }
Here is the call graph for this function:
JNIEXPORT jint JNICALL Java_csql_jdbc_JSqlStatement_prepare | ( | JNIEnv * | , | |
jobject | , | |||
jstring | ||||
) |
Definition at line 122 of file JSqlStatement.cxx.
References AbsSqlStatement::prepare().
00123 { 00124 jclass cls; 00125 jfieldID fid; 00126 00127 cls = env->GetObjectClass(obj); 00128 fid = env->GetFieldID( cls, "sqlStmtPtr", "J"); 00129 if (fid == 0) 00130 { 00131 jclass Exception = env->FindClass("java/lang/Exception"); 00132 env->ThrowNew(Exception,"JNI: GetFieldID failed.\n"); 00133 return(-1); 00134 } 00135 AbsSqlStatement *s = (AbsSqlStatement*) env->GetLongField( obj, fid ); 00136 jboolean isCopy = JNI_TRUE; 00137 char *stmtString = (char*) env->GetStringUTFChars(stmt, &isCopy ); 00138 int rv = s->prepare(stmtString); 00139 return rv; 00140 }
Here is the call graph for this function:
JNIEXPORT void JNICALL Java_csql_jdbc_JSqlStatement_setByte | ( | JNIEnv * | , | |
jobject | , | |||
jint | , | |||
jbyte | ||||
) |
Definition at line 326 of file JSqlStatement.cxx.
References AbsSqlStatement::setByteIntParam(), and stmt.
00327 { 00328 jclass cls; 00329 jfieldID fid; 00330 00331 cls = env->GetObjectClass( obj ); 00332 fid = env->GetFieldID( cls, "sqlStmtPtr", "J"); 00333 if (fid == 0) 00334 { 00335 jclass Exception = env->FindClass("java/lang/Exception"); 00336 env->ThrowNew(Exception,"JNI: GetFieldID failed.\n"); 00337 return; 00338 } 00339 AbsSqlStatement *stmt = (AbsSqlStatement*) env->GetLongField( obj, fid ); 00340 stmt->setByteIntParam(position, (ByteInt) value); 00341 return; 00342 }
Here is the call graph for this function:
JNIEXPORT void JNICALL Java_csql_jdbc_JSqlStatement_setConnectionPtr | ( | JNIEnv * | , | |
jobject | , | |||
jlong | ||||
) |
Definition at line 97 of file JSqlStatement.cxx.
References AbsSqlStatement::setConnection(), and stmt.
00098 { 00099 00100 jclass cls; 00101 jfieldID fid; 00102 00103 cls = env->GetObjectClass(obj); 00104 fid = env->GetFieldID( cls, "sqlStmtPtr", "J"); 00105 if (fid == 0) 00106 { 00107 jclass Exception = env->FindClass("java/lang/Exception"); 00108 env->ThrowNew(Exception,"JNI: GetFieldID failed.\n"); 00109 return; 00110 } 00111 AbsSqlStatement *stmt = (AbsSqlStatement*) env->GetLongField( obj, fid); 00112 stmt->setConnection((AbsSqlConnection*) conn); 00113 return; 00114 }
Here is the call graph for this function:
JNIEXPORT void JNICALL Java_csql_jdbc_JSqlStatement_setDate | ( | JNIEnv * | , | |
jobject | , | |||
jint | , | |||
jobject | ||||
) |
Definition at line 425 of file JSqlStatement.cxx.
References AbsSqlStatement::setDateParam(), and stmt.
00427 { 00428 jclass cls, datecls; 00429 jfieldID fid; 00430 jmethodID dateMethod; 00431 00432 cls = env->GetObjectClass( obj ); 00433 fid = env->GetFieldID( cls, "sqlStmtPtr", "J"); 00434 if (fid == 0) 00435 { 00436 jclass Exception = env->FindClass("java/lang/Exception"); 00437 env->ThrowNew(Exception,"JNI: GetFieldID failed.\n"); 00438 return; 00439 } 00440 AbsSqlStatement *stmt = (AbsSqlStatement*) env->GetLongField( obj, fid ); 00441 00442 // Get date, month, year from java object 00443 int d, m, y; 00444 datecls = env->GetObjectClass( dateObj ); 00445 dateMethod = env->GetMethodID( datecls, "getYear", "()I"); 00446 y = env->CallIntMethod( dateObj, dateMethod); 00447 dateMethod = env->GetMethodID( datecls, "getMonth", "()I"); 00448 m = env->CallIntMethod( dateObj, dateMethod); 00449 dateMethod = env->GetMethodID( datecls, "getDate", "()I"); 00450 d = env->CallIntMethod( dateObj, dateMethod); 00451 00452 Date date(y + 1900, m + 1, d); 00453 stmt->setDateParam(position, date); 00454 00455 return; 00456 }
Here is the call graph for this function:
JNIEXPORT void JNICALL Java_csql_jdbc_JSqlStatement_setDouble | ( | JNIEnv * | , | |
jobject | , | |||
jint | , | |||
jdouble | ||||
) |
Definition at line 373 of file JSqlStatement.cxx.
References AbsSqlStatement::setDoubleParam(), and stmt.
00374 { 00375 jclass cls; 00376 jfieldID fid; 00377 00378 cls = env->GetObjectClass( obj ); 00379 fid = env->GetFieldID( cls, "sqlStmtPtr", "J"); 00380 if (fid == 0) 00381 { 00382 jclass Exception = env->FindClass("java/lang/Exception"); 00383 env->ThrowNew(Exception,"JNI: GetFieldID failed.\n"); 00384 return; 00385 } 00386 AbsSqlStatement *stmt = (AbsSqlStatement*) env->GetLongField( obj, fid ); 00387 stmt->setDoubleParam(position, (double) value); 00388 return; 00389 }
Here is the call graph for this function:
JNIEXPORT void JNICALL Java_csql_jdbc_JSqlStatement_setFloat | ( | JNIEnv * | , | |
jobject | , | |||
jint | , | |||
jfloat | ||||
) |
Definition at line 349 of file JSqlStatement.cxx.
References AbsSqlStatement::setFloatParam(), and stmt.
00350 { 00351 jclass cls; 00352 jfieldID fid; 00353 00354 cls = env->GetObjectClass( obj ); 00355 fid = env->GetFieldID( cls, "sqlStmtPtr", "J"); 00356 if (fid == 0) 00357 { 00358 jclass Exception = env->FindClass("java/lang/Exception"); 00359 env->ThrowNew(Exception,"JNI: GetFieldID failed.\n"); 00360 return; 00361 } 00362 AbsSqlStatement *stmt = (AbsSqlStatement*) env->GetLongField( obj, fid ); 00363 stmt->setFloatParam(position, (float) value); 00364 return; 00365 }
Here is the call graph for this function:
JNIEXPORT void JNICALL Java_csql_jdbc_JSqlStatement_setInt | ( | JNIEnv * | , | |
jobject | , | |||
jint | , | |||
jint | ||||
) |
Definition at line 278 of file JSqlStatement.cxx.
References AbsSqlStatement::setIntParam(), and stmt.
00279 { 00280 jclass cls; 00281 jfieldID fid; 00282 00283 cls = env->GetObjectClass( obj ); 00284 fid = env->GetFieldID( cls, "sqlStmtPtr", "J"); 00285 if (fid == 0) 00286 { 00287 jclass Exception = env->FindClass("java/lang/Exception"); 00288 env->ThrowNew(Exception,"JNI: GetFieldID failed.\n"); 00289 return; 00290 } 00291 AbsSqlStatement *stmt = (AbsSqlStatement*) env->GetLongField( obj, fid ); 00292 stmt->setIntParam(position, (int) value); 00293 return; 00294 }
Here is the call graph for this function:
JNIEXPORT void JNICALL Java_csql_jdbc_JSqlStatement_setLong | ( | JNIEnv * | , | |
jobject | , | |||
jint | , | |||
jlong | ||||
) |
Definition at line 302 of file JSqlStatement.cxx.
References AbsSqlStatement::setLongParam(), and stmt.
00303 { 00304 jclass cls; 00305 jfieldID fid; 00306 00307 cls = env->GetObjectClass( obj ); 00308 fid = env->GetFieldID( cls, "sqlStmtPtr", "J"); 00309 if (fid == 0) 00310 { 00311 jclass Exception = env->FindClass("java/lang/Exception"); 00312 env->ThrowNew(Exception,"JNI: GetFieldID failed.\n"); 00313 return; 00314 } 00315 AbsSqlStatement *stmt = (AbsSqlStatement*) env->GetLongField( obj, fid ); 00316 stmt->setLongParam(position, (long) value); 00317 return; 00318 }
Here is the call graph for this function:
JNIEXPORT void JNICALL Java_csql_jdbc_JSqlStatement_setNull | ( | JNIEnv * | , | |
jobject | , | |||
jint | ||||
) |
JNIEXPORT void JNICALL Java_csql_jdbc_JSqlStatement_setShort | ( | JNIEnv * | , | |
jobject | , | |||
jint | , | |||
jshort | ||||
) |
Definition at line 254 of file JSqlStatement.cxx.
References AbsSqlStatement::setShortParam(), and stmt.
00255 { 00256 jclass cls; 00257 jfieldID fid; 00258 00259 cls = env->GetObjectClass( obj ); 00260 fid = env->GetFieldID( cls, "sqlStmtPtr", "J"); 00261 if (fid == 0) 00262 { 00263 jclass Exception = env->FindClass("java/lang/Exception"); 00264 env->ThrowNew(Exception,"JNI: GetFieldID failed.\n"); 00265 return; 00266 } 00267 AbsSqlStatement *stmt = (AbsSqlStatement*) env->GetLongField( obj, fid ); 00268 stmt->setShortParam(position, (short) value); 00269 return; 00270 }
Here is the call graph for this function:
JNIEXPORT void JNICALL Java_csql_jdbc_JSqlStatement_setString | ( | JNIEnv * | , | |
jobject | , | |||
jint | , | |||
jstring | ||||
) |
Definition at line 397 of file JSqlStatement.cxx.
References AbsSqlStatement::setStringParam(), and stmt.
00398 { 00399 jclass cls; 00400 jfieldID fid; 00401 00402 cls = env->GetObjectClass( obj ); 00403 fid = env->GetFieldID( cls, "sqlStmtPtr", "J"); 00404 if (fid == 0) 00405 { 00406 jclass Exception = env->FindClass("java/lang/Exception"); 00407 env->ThrowNew(Exception,"JNI: GetFieldID failed.\n"); 00408 return; 00409 } 00410 00411 jboolean isCopy = JNI_TRUE; 00412 char *valueStr = (char*) env->GetStringUTFChars( value, &isCopy ); 00413 00414 AbsSqlStatement *stmt = (AbsSqlStatement*) env->GetLongField( obj, fid ); 00415 stmt->setStringParam(position, valueStr); 00416 return; 00417 }
Here is the call graph for this function:
JNIEXPORT void JNICALL Java_csql_jdbc_JSqlStatement_setTime | ( | JNIEnv * | , | |
jobject | , | |||
jint | , | |||
jobject | ||||
) |
Definition at line 465 of file JSqlStatement.cxx.
References AbsSqlStatement::setTimeParam(), and stmt.
00467 { 00468 jclass cls, timecls; 00469 jfieldID fid; 00470 jmethodID timeMethod; 00471 00472 cls = env->GetObjectClass( obj ); 00473 fid = env->GetFieldID( cls, "sqlStmtPtr", "J"); 00474 if (fid == 0) 00475 { 00476 jclass Exception = env->FindClass("java/lang/Exception"); 00477 env->ThrowNew(Exception,"JNI: GetFieldID failed.\n"); 00478 return; 00479 } 00480 AbsSqlStatement *stmt = (AbsSqlStatement*) env->GetLongField( obj, fid ); 00481 00482 // Get hour, minures, secs from java object 00483 int h, m, s; 00484 timecls = env->GetObjectClass( timeObj ); 00485 timeMethod = env->GetMethodID( timecls, "getHours", "()I"); 00486 h = env->CallIntMethod( timeObj, timeMethod); 00487 timeMethod = env->GetMethodID( timecls, "getMinutes", "()I"); 00488 m = env->CallIntMethod( timeObj, timeMethod); 00489 timeMethod = env->GetMethodID( timecls, "getSeconds", "()I"); 00490 s = env->CallIntMethod( timeObj, timeMethod); 00491 00492 Time time(h, m, s, 0); 00493 stmt->setTimeParam(position, time); 00494 00495 return; 00496 }
Here is the call graph for this function:
JNIEXPORT void JNICALL Java_csql_jdbc_JSqlStatement_setTimestamp | ( | JNIEnv * | , | |
jobject | , | |||
jint | , | |||
jobject | ||||
) |
Definition at line 504 of file JSqlStatement.cxx.
References AbsSqlStatement::setTimeStampParam(), and stmt.
00506 { 00507 jclass cls, timecls; 00508 jfieldID fid; 00509 jmethodID timeMethod; 00510 00511 cls = env->GetObjectClass( obj ); 00512 fid = env->GetFieldID( cls, "sqlStmtPtr", "J"); 00513 if (fid == 0) 00514 { 00515 jclass Exception = env->FindClass("java/lang/Exception"); 00516 env->ThrowNew(Exception,"JNI: GetFieldID failed.\n"); 00517 return; 00518 } 00519 AbsSqlStatement *stmt = (AbsSqlStatement*) env->GetLongField( obj, fid ); 00520 00521 // Get year, month, day, hour, minutes, secs from java object 00522 int y, mo, d, h, mn, s; 00523 timecls = env->GetObjectClass( timeObj ); 00524 00525 timeMethod = env->GetMethodID( timecls, "getYear", "()I"); 00526 y = env->CallIntMethod( timeObj, timeMethod ); 00527 timeMethod = env->GetMethodID( timecls, "getMonth", "()I"); 00528 mo = env->CallIntMethod( timeObj, timeMethod ); 00529 timeMethod = env->GetMethodID( timecls, "getDate", "()I"); 00530 d = env->CallIntMethod( timeObj, timeMethod ); 00531 timeMethod = env->GetMethodID( timecls, "getHours", "()I"); 00532 h = env->CallIntMethod( timeObj, timeMethod); 00533 timeMethod = env->GetMethodID( timecls, "getMinutes", "()I"); 00534 mn = env->CallIntMethod( timeObj, timeMethod); 00535 timeMethod = env->GetMethodID( timecls, "getSeconds", "()I"); 00536 s = env->CallIntMethod( timeObj, timeMethod); 00537 00538 TimeStamp timeStamp(y + 1900, mo + 1, d, h, mn, s, 0); 00539 stmt->setTimeStampParam(position, timeStamp); 00540 00541 return; 00542 }
Here is the call graph for this function: