Skip to content

Tag: java

Java socket client/server

Hi i am trying to get some data about a socket client connecting to a mutltythreaded server process in the same machine. The server thread is triggered correctly and the client ip is retreived ok, but i cant seem to be able to send a string through the connection. THE CLIENT THE SERVER THREAD The line sent th…

SQLite in Android How to update a specific row

I’ve been trying to update a specific row for a while now, and it seems that there are two ways to do this. From what I’ve read and tried, you can just use the: execSQL(String sql) method or the: update(String table, ContentValues values, String whereClause, String[] whereArgs) method. (Let me kno…

Clarification of Java/SQLite batch and auto-commit

I copied the following example from an SQLite Java library website: I’m struggling to understand the significance of toggling autoCommit() either side of executeBatch(). Does it merely prevent a commit being made for each individual batch operation? Thus a single ‘bulk’ commit is will be mad…

java.sql.SQLException: ORA-01843: not a valid month

I am getting the following error when inserting data into my oracle database. In database date is as: dd-MMM-yy (06-MAR-12) I am converting 06-03-2012 to dd-MMM-yy by the following method: So i got 06-Mar-12 which is same as the above database date format still i am getting the error. I am inserting as: in in…

BatchSqlUpdate – how to get auto generated keys

I am using spring BatchSqlUpdate to insert a set of rows. How do I get the auto generated keys for all of the rows inserted? When doing a single insert I get the keys like this – Thanks! Answer There is no provided solution for this using BatchSqlUpdate as far as I know, but you can always query the las…

What does the following Oracle error mean: invalid column index

I got the following error while testing some code: SQLException: Invalid column index What exactly does that mean? Is there an online document explaining what all the Oracle error codes and statements? Answer If that’s a SQLException thrown by Java, it’s most likely because you are trying to get o…