I have the following .sql file:
CREATE DATABASE IF NOT EXISTS `peertopeer` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `peertopeer`;
DROP TABLE IF EXISTS `songs`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `songs` (
`idsongs` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) DEFAULT NULL,
`artist` varchar(45) DEFAULT NULL,
`album` varchar(45) DEFAULT NULL,
`genre` varchar(45) DEFAULT NULL,
`year` int(11) DEFAULT NULL,
`hash` varchar(32) DEFAULT NULL,
PRIMARY KEY (`idsongs`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `songs`
--
LOCK TABLES `songs` WRITE;
/*!40000 ALTER TABLE `songs` DISABLE KEYS */;
INSERT INTO `songs` VALUES (1,'requiem','mozart','unknown','classical',1791,'9a1be396c886d97a60f5d4f9d6cd1f08'),(2,'four seasons','vivaldi','unknown','classical',1725,'425f51ff63ff6621819dedb448704dba'),(3,'temple of the king','\"\"','ritchie blackmore\'s rainbow','classical rock',1975,'a6369ea7a1fd7fb1fc7c055218f894ac'),(4,'holy diver','dio','holy diver','heavy metal',1983,'5cc1847e0788eb9aaf7cab43460a22b5'),(5,'vodka','korpiklaani','karkelo','folk metal',NULL,'97ffd653375a1d2aadda9206c92b03c0'),(6,'\"\"','miles davis','\"\"','\"\"',NULL,'82f7d372319db9b5f0b54e2c8517dd81'),(7,'i don\'t want to set the world on fire','the ink spots','smoothie','jazz',1941,'8539ef14ef46a611d346ad15f32d784d');
/*!40000 ALTER TABLE `songs` ENABLE KEYS */;
UNLOCK TABLES;
Now in my java code, I've connected to the mysql by using JDBC . However, I could not find a way to run this file so that, sql commands will be executed and corresponding tables are created. How could I Do it? I know there are many such questions but most of them says that JDBC does not support such an operation.