I want to ask how to send string object or text in the insert query. or string or text from textfield to database............ reply with small example
I think you'd be best served using a PREPARED STATEMENT. For example... Code: // con is the active Database Connection // All of this is in a try-catch block String mySqlString = "update THETABLE set TEXTMESSAGE = ? where MESSAGEID = ?"; PreparedStatement myStatement = con.prepareStatement(mySqlString); myStatement.setString(1, theVeryLongTextMessage); myStatement.setInt(2, messageID); myStatement.executeUpdate(); You could refer to http://docs.oracle.com/javase/tutorial/jdbc/basics/prepared.html for more information regarding prepared statements. Good luck with your code.