How would you go about loading a .sql file into a mysql database from a java program? I ve tried extracting a sql resource file from the self containted jar, I ve try processBuilder to locate and run external shell commands. I ve tried about everything and none of which seem like the correct way about doing this.
www.un.org/spanish/ecosoc 因此,看一看问题,我只是这样做:。
在任何数据库中,均采用了我的假设:mysqldump -uroot -routines myDB >~/Desktop/myDB.sql
。
www.un.org/spanish/ecosoc 现在,请设法从java/jdbc一皮中恢复整个数据库。 如何适当和正确地用我的手提B.sql档案这样做?
It might be nice to think you create a nice jdbc statement to loop around your databse file but then it gets ugly and bunk when you do get a section of your dump like this
<>m>Problem, 如下所示:
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE= +00:00 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE= NO_AUTO_VALUE_ON_ZERO */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `DOG`
--
DROP TABLE IF EXISTS `DOG`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `DOG` (
`DOG_ID` mediumint(9) NOT NULL,
`OWNER_ID` mediumint(9) NOT NULL,
PRIMARY KEY (`DOG_ID`),
KEY `CHANNEL_FK1` (`OWNER_ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
www.un.org/spanish/ecosoc 这是否限制了jdbc? 是否有一只冰皮,我可以称之为我的sql.createDatabase(myDB.sql)。