This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
It will be almost correct if your table only has a single column of a text type. You should remove the quotes from the table name, first, though. As with "select" statements, it's almost always better to specify the column names: int result = stmt.executeUpdate("insert into " + table + " (colname) values('" + tableValue + "')" ); If your column has a numeric type, you should not put quotes on the value either: int result = stmt.executeUpdate("insert into " + table + " (colname) values(" + tableValue + ")" );