public static void main(String[] args) throws IOException {
		
		String driver = "com.mysql.jdbc.Driver";
		String url = "jdbc:mysql://127.0.0.1:3306/export";
		String user = "root";
		String password = "root";

		/**
		 * Class.forName("oracle.jdbc.driver.OracleDriver");
		   Connection conn = DriverManager.getConnection(
					"jdbc:oracle:thin:@127.0.0.1:1521:test", "scott", "tiger");
		 */
		try {
			Class.forName(driver);
			Connection conn = DriverManager.getConnection(url, user, password);
			if (!conn.isClosed())
				System.out.println("Succeeded connecting to the Database!");
			Statement statement = conn.createStatement();
			String sql = "show tables;";
			ResultSet rs = statement.executeQuery(sql);
			ResultSetMetaData rsmd = rs.getMetaData();
			int count = rsmd.getColumnCount();
			System.out.println(count);
			String[] name = new String[count];
			for(int i=0;i<count;i++){
				name[i]=rsmd.getColumnName(i+1);
				System.out.println(rsmd.getColumnName(i+1));
			}
			while (rs.next()) {
				System.out.println(rs.getString(1) + " : " + rs.getString(2) + " : " + rs.getString(3));
				
			}
			rs.close();
			conn.close();
		} catch (ClassNotFoundException e) {
			System.out.println("Sorry,can`t find the Driver!");
			e.printStackTrace();
		} catch (SQLException e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}