1, the installation of MySQL diagram.
2, the difference between different databases on the impact of the program
1) Data type
2) Paging problem
SQL paging is fairly simple, and the paging is different for different databases. SQL Server is also simpler, only Oracle is more difficult.
3 Automatic increment field of database
3, the date of MySQL processing
4, connect to the Java connection to the MySQL verification instance:
Import java.sql.*; public class Testmysqlconnection {/** * @param args */public static void main (string[] args) {Connection conn
= NULL;
Statement stmt = null;
ResultSet rs = null;
try {class.forname ("com.mysql.jdbc.Driver");
conn = DriverManager. getconnection ("jdbc:mysql://localhost/mstx?user=root&password=123456");
stmt = Conn.createstatement ();
rs = Stmt.executequery ("SELECT * from Mstx_head");
while (Rs.next ()) {System.out.println (rs.getstring ("Tname"));
} catch (ClassNotFoundException e) {e.printstacktrace ();
catch (SQLException ex) {System.out.println ("SQLException:" + ex.getmessage ());
System.out.println ("SQLState:" + ex.getsqlstate ());
System.out.println ("Vendorerror:" + ex.geterrorcode ());
Finally {try {if (rs!= null) {rs.close ();
rs = null;
} if (stmt!= null) {stmt.close ();
stmt = null;
} if (conn!= null) {conn.close ();
conn = null;} catch (SQLException e) {e.printstacktrace ();
}
}
}
}
5, English documents, personal fear, do not dare to move caused. Find Example Programs
6, show databases, show tables;
Attention:
Before building a table, you must add a use---to the front;