1、标准事务的编程模式:1:定义一个在事务中执行的SQL语句2:获得自动提交的状态:boolean flag=connection . getAutoCommit( 默认是true );

2、3:关闭自动提交: connection . setAutoCommit( false );4:执行SQL语句5:提交:connection . commit( );6:将自动提交功能恢复到原始的状态 : connection.setAutoCommit(flag);7:回滚 :connection .rollback( );

3、SQL语句的优化?解:1:保证不查询多余的列与行!2:慎用distinct关键字,distinct在查询一个字段或者很少字段的情况下使用,会避免重复数据的出现,给查询带来优化效果。但是查询字段很多的情况下使用,则会大大降低查询效率。

1、3:慎用union关键字(合并select的结果集)4:insert插入优化:insert into 批量插入明显提升效率。所以以后尽量避免一个个循环插入5:优化修改删除语句:分批操作数据。delete product where id>=1000 and id<2000

2、什么是css?css中有哪几种选择器,语法是什么解:css:层叠样式表,它是一种用来表现HTML或XML等文件样式的计算机语言。1:元素选择器:body{...};2:类选择器:.class{...};3:id选择器:#id{...};4:选择器组:.class,div{...};5:派生选择器:p Strong{...}; p>Strong{...};

3、6:伪类选择器:link:向未被访问的超链接添加样式visited:向已被访问的超链接添加样式active:向被激活的元素添加样式hover:鼠标悬停时添加样式focus:获取焦点时添加样式

4、BufferedReader bufr = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bufw = new BufferedWriter(new OntputStreamWriter(System.out)); String line = null; while((line = bufr.readLine())!=null) {

5、 if("over".equals(line)) break; bufw.write(line.toUpperCase()); bufw.newLine(); bufw.flush(); } bufr.close(); bufw.close();
