`
michaels888
  • 浏览: 6560 次
社区版块
存档分类
最新评论
文章列表
请求头:accept:浏览器通过这个头告诉服务器,它所支持的数据类型Accept-Charset: 浏览器通过这个头告诉服务器,它支持哪种字符集Accept-Encoding:浏览器通过这个头告诉服务器,支持的压缩格式Accept-Language:浏览器通过这个头告诉服务器,它的语言环境Host:浏览器通过这个头告诉服务器,想访问哪台主机If-Modified-Since: 浏览器通过这个头告诉服务器,缓存数据的时间Referer:浏览器通过这个头告诉服务器,客户机是哪个页面来的  防盗链Connection:浏览器通过这个头告诉服务器,请求完后是断开链接还是何持链接         ...
在数据库操作中,比较Statement和PreparedStatement的异同?1.使用Statement和PreparedStatement都可以实现sql语句的执行,实现增删改查 2.Statement是PreparedStatement的父接口 3.开发中,包括DBUtils.jar包中提供的现成的增删改查都是使用PreparedStatement  原因在于:1.Statement的问题:①需要拼串②存在sql注入。相比较来说,PreparedStatement可以           解决Statement的问题         2.PreparedStatement可以实现Blob ...
  使用PrepareStatement编写通用的增删改方法, 通用的查询方法(返回一条记录 或者返回多条记录)   public class TestPrepateStatement { //解决Statement的sql注入问题  @Test  public void test3(){   Scanner s = new Scanner(System.in);   System.out.println("请输入user:");   String user = s.nextLine();   System.out.println("请输入password: ...
1、使用equals( )方法比较两个字符串是否相等。它具有如下的一般形式: boolean equals(Object str) 这里str是一个用来与调用字符串(String)对象做比较的字符串(String)对象。如果两个字符串具有相同的字符和长度,它返回true,否则返回false。这种比较是区分大小写的。 2、为了执行忽略大小写的比较,可以调用equalsIgnoreCase( )方法。当比较两个字符串时,它会认为A-Z和a-z是一样的。其一般形式如下: boolean equalsIgnoreCase(String str) 这里,str是一个用来与调用字符串(Str ...
TestResultSetMetaDate-结果集元数据:封装了ResultSet中所有的信息,比如有列数,表中列的别名(lable),表中列的名字   public class TestResultSetMetaDate { @Test public void testResultSetMetaDate(){  Connection connection = null;  Statement s = null;  ResultSet rs = null;  try {   connection = JDBCUtils.getConnection();   s = connection.c ...
要导入beanutils.jar、logging.jar两个包 用来将获取的数据封装到javabean对应的属性中 public class TestPropertyUtils { @Test public void testPropertyUtils() throws Exception, InvocationTargetException, NoSuchMethodException{  Customer customer = new Customer();  PropertyUtils.setProperty(customer, "id", 5);  Proper ...
public class TestJDBC { @Test public void test3(){//  String sql = "select id, name, email, birth from customers where id <10";//  List<Customer> list = getForList(sql, Customer.class);//  for(Customer customer : list){//   System.out.println(customer);//  }  String sql1 = "se ...
public class JDBCUtils { public static Connection getConnection() throws Exception{  InputStream is = new FileInputStream(new File("jdbc.properties"));  Properties p = new Properties();  p.load(is);  String driverName =  p.getProperty("driverName");  String url = p.getProperty(& ...
driverName=com.mysql.jdbc.Driverurl=jdbc:mysql://localhost:3306/testuser=rootpassword=root #url=jdbc:oracle:thin:@127.0.0.1:1521/orcl#user=scott#password=tiger#driverName=oracle.jdbc.driver.OracleDriver
Global site tag (gtag.js) - Google Analytics