public void insert() {
		Connection conn = null;
		PreparedStatement pstmt = null;
		try {
			//1、加载驱动
			Class.forName("com.mysql.jdbc.Driver");
			String mysqlUrl = "jdbc:mysql://localhost:3306/rock";
			//2、建立连接
			conn = DriverManager.getConnection(mysqlUrl,"root","123456");
			String sql = "insert into emp2(ename,sal) values(?,?)";
			//3、选择处理快（预处理块）
			pstmt = conn.prepareStatement(sql);
			//4、拼接sql语句，填入执行参数，执行
			pstmt.setString(1, "rock3");
			pstmt.setDouble(2, 100.0);
			//5、分析结果
			int result = pstmt.executeUpdate();
			System.out.println(result);	
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (SQLException e) {
			e.printStackTrace();
		} finally {
			//6、释放资源
				try {
					if(null !=pstmt) {						
						pstmt.close();
					}
					if(null !=conn) {						
						conn.close();
					}
				} catch (SQLException e) {
					e.printStackTrace();
				}
		}
	}