![]() ![]() Let us create a table with name sales in MySQL database, with one of the columns as auto-incremented, using CREATE statement as shown below − CREATE TABLE Sales(įollowing JDBC program establishes a connection with the database and inserts 5 records into the sales table − import java.sql. ![]() While inserting data into a table with auto-incremented column, just leave that particular column out and insert remaining values by specifying the remaining columns using the following syntax of the INSERT statement − INSERT into table_name (column_name1, column_name2.) values(value1, value2.) Example
0 Comments
Leave a Reply. |