Hi All,
First, please accept my apology if I am not providing enough information here..If so, please feel free to ask and I will collect those.
Also, it would be great if you can help me on how to get those information too...:-)
I am new in
Java world..I am working on a task that requires to add/delete/select/modify records from informix database..
I have been working with similar code but having these DML statement as part of stored procedures and all worked okay.
This time, I need to write direct insert and select statement instead of having those in stored procedure. It seems like I am getting
an error while using insert statment..For
testing, if I simply changed the insert statement with an update statement, it works just fine..
Do anyone know what might be causing an issue here?
Here is more details..
String lvINS_MA = String.format( " INSERT INTO tab_1(ma_serialno, ma_mm_serialno, ma_md_serialno, ma_md_mm_serialno, ma_extra1) VALUES(0,?,?,?,?) " );
//String.format("update tab_1 set (ma_mm_serialno) = ( 0 ) where ma_serialno = 1 " ); <-- If I replace the above line with this line, it works okay...
PreparedStatement psInsMA = null;
try {
psInsMA = conn.prepareStatement(lvIns_MA); <-- This lines throws an exception as "java.sql.SQLException: System or internal error java.lang.NullPointerException"
} catch (Exception e ) {
External.LogMsg(LOGLEVEL_ERROR, String.format("Prepare Statements : Error [%s] ", e.toString()));
}
Please note, the conn is correctly filled with correct values , like database, user etc..As stated earlier, it occurs only when I used the "INSERT" statement...When I run the same code with "UPDATE" statement line, it just works fine..
Thanks in advance...
Regards,
DDS