Whatever message this page gives is out now! Go check it out!

Populating the database using script

Last update:
Jun 9, 2026
After the tables are created using DDL, you can optionally populate the database with data using SQL script. To do this, specify the path (absolute file path or path relative to the application) to the SQL script file that has to be executed. The script is run only when dbcreate is set to dropcreate. The SQL script file lets you populate the tables before the application is accessed. Ensure that each SQL statement starts on a new line and ends with a semi-colon.

Example

Mysqlscript.sql
insert into Artists(artistid, firstname, lastname, address, city, state, postalcode, email, phone, fax, thepassword) 
 values(1, 'Aiden', 'Donolan', '352 Corporate Ave.', 'Denver', 'CO', '80206-4526', 'aiden.donolan@donolan.com', '555-751-8464', '555-751-8463', 'peapod'); 
 insert into Artists(artistid, firstname, lastname, address, city, state, postalcode, email, phone, fax, thepassword) 
 values(2, 'Austin', 'Weber', '25463 Main Street, Suite C', 'Berkeley', 'CA', '94707-4513', 'austin@life.com', '555-513-4318', '510-513-4888', 'nopolyes'); 
 insert into Art(artname, price, largeimage, mediaid, issold, artistid) 
 values('Michael', 13900, 'aiden02.jpg', 1, 0, 1); 
 insert into Art(artname, price, largeimage, mediaid, issold, artistid) 
 values('Space', 9800, 'elecia01.jpg', 2, 1, 2);

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page