It can be done in different way. You can create a script file (.sql) which will do all the database specific job like creating tables and loading sample data. Package your web application as war file. And write a
java file which calls the .sql file and deploy the war file. Create a jar like setup.jar and put the java file there, change the Manifest.MF file of the jar so that if some one clicks the jar it loads the db and then deploy the webapp. Providing a readme file will be a good idea. Instead of jar file you can create a .bat file in which also do the same. Or you can work with
ANT script to do all the things starting from database set up to deploying the web application.