Results 1 to 1 of 1
Thread: Inserting into a table (Example)
-
Inserting into a table (Example)
Presented below is a simple example of how to insert a row in a database table.
Java Code:Statement stmt; String sql; int rows; sql = "INSERT INTO tCust " + "(custId, custName, custAddr) " + "VALUES " + "('" + custId + "'," + "('" + custName + "'," + "('" + custAddr + "')"; stmt = theConn.createStatement(); rows = stmt.executeUpdate(sql); theConn.dbConn.commit(); stmt.close();
Similar Threads
-
Inserting current date into a DB table
By Java Tip in forum Java TipReplies: 0Last Post: 02-15-2008, 08:38 AM -
PreparedStatement - inserting date
By Java Tip in forum Java TipReplies: 0Last Post: 02-11-2008, 08:44 AM -
Inserting data containing quotes into DB
By Java Tip in forum Java TipReplies: 0Last Post: 02-06-2008, 09:28 AM -
menu inserting table in the document
By daredavil82 in forum New To JavaReplies: 0Last Post: 12-05-2007, 05:05 PM -
inserting bit value in sqlserver2000 using hibernate
By javadev in forum JDBCReplies: 0Last Post: 06-07-2007, 02:15 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks