Scenario 1: Export the database file-Import
Scenario 2:navicat prrmium Data transfer
Good effect between the same database software, there are some problems between different database software
Scenario 3: Write the program, connect the old database, take out the data, connect to the new database, and deposit the data
class.forname ("Oracle.jdbc.driver.OracleDriver"); String url = "jdbc:oracle:thin:@" +servername+ ": 1521:eclipsedb"; Connection connoracle = drivermanager.getconnection (URL, "Eclipse", "888888"); Connect source data source Statement stmt = Connoracle.createstatement (); ResultSet rs = stmt.executequery ("SELECT * from employee"); Class.forName ("Sun.jdbc.odbc.JdbcOdbcDriver"); Connection connaccess = drivermanager.getconnection ("Jdbc:odbc:target", "", "" "); Connecting the target data source PreparedStatement pstmt = connaccess.preparestatement ("INSERT into employee (id,name,department,salary) VALUES (?,?,?,?) "); /cyclic loading data while (Rs.next ()) {Pstmt.setint (1,rs.getint ("id")); Pstmt.setstring (2,rs.getstring ("name")); Pstmt.setstring (3,rs.getstring ("department")); Pstmt.setdouble (4,rs.getdouble ("salary")); Pstmt.executeupdate ();} Release resources Rs.close (); Stmt.close ();p stmt.close (); Connoracle.close (); Connaccess.close ();
From http://zhengshuo3527.blog.163.com/blog/static/615348220073381530569/
Data migration of relational database in different relational database