Skip to content
Advertisement

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 through is empty.

NonUniqueDiscoveredSqlAliasException when two table has same column names

I have two tables Item and Nikasa – whose definitions looks like: Item { id, name, spec} and Nikasa {id, date, item_id}. Here item_id represents Item.id. I did a simple native SQL join to select only Item.id and Nikasa.id as: But I am getting exception NonUniqueDiscoveredSqlAliasException : Encountered a duplicated sql alias [ID] during auto-discovery of a native-sql query at

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 know if this is incorrect as I am new to

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 made by setAutoCommit(true). Answer The auto commit is disabled before batch because enabling auto commit

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 index.jsp in servlet(doPost) Any idea please

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 last

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 or set a value from a ResultSet, but the index you

Advertisement