- 博客(10)
- 收藏
- 关注
原创 SQL优化
什么是SQL优化? 一般来说,SQL优化是让SQL运行得更快,使SQL更快的方式有很多,比如提高索引的使用效率,或者并行查询。 优化公式:T=S/V 执行效率或者一般说的执行时间,是和完成一次SQL所需要访问的资源总量(S)成正比以及单位时间内能够访问的资源量(V)成反比,S越大,效率越低,V越大效率越高。 比如通过并行查询,则可以提升单位时间内访问的资源量。 当然,这仅仅是从执行时间上考虑,SQL优化肯定不仅仅是执行时间降低,应该是资源使用与执行时间降低之间寻求一种平衡,否则,盲目并行,可能提升不
2021-12-23 23:15:19
653
原创 Java中的常用类-包装类
String类 常用方法: 1、boolean equalslgnoreCase(String anotherString) 对比此字符串对象与指定内容进行忽略大小写的对比。 2、char charAt(int index) 返回指定index处的char值 3、String concat(String str) 将指定的字符串str连接到当前字符串的末尾,并返回此新字符串对象 4、boolean contains(CharSequence s) 此字符串对象是否含指定的字符序列(一般可以认为是字
2021-12-12 23:05:14
357
原创 Maven中使用监听器
1.开启监听器: 在web.xml中配置: <listener> <listener-class>com.zsq.listener.SessionManagerListener</listener-class> </listener> 2.监听页面 public class SessionManagerListener implements HttpSessionListener { public static M
2021-12-05 20:25:21
911
原创 String 类的常用方法
1、indexOf():返回指定字符的索引。 2、charAt():返回指定索引处的字符。 3、replace():字符串替换。 4、trim():去除字符串两端空白。 5、split():分割字符串,返回一个分割后的字符串数组。 6、getBytes():返回字符串的 byte 类型数组。 7、length():返回字符串长度。 8、toLowerCase():将字符串转成小写字母。 9、toUpperCase():将字符串转成大写字符。 10、substring():
2021-11-25 22:39:28
187
原创 Java中的冒泡排序
public static void main(String[] args) { int []arr = {3,9,1,4,6}; for (int i = 0; i < arr.length; i++) { for (int j = i+1; j < arr.length; j++) { int sout; if (arr[i]>arr[j]) { sout=arr[i]; arr[i]=arr[j]; arr[j]=sout.
2021-11-24 22:35:23
278
原创 java中的九九乘法表
public static void main(Demo19[] args) { for (int i = 1; i <=9; i++) { for (int j = 1; j <= i; j++) { System.out.print(i+"*"+j+"="+i*j+"\t"); } System.out.println(" "); } }
2021-11-23 23:07:01
355
原创 request.getAttribute() 和 request.getParameter()的区别
1、request.getParameter()取得是通过容器的实现来取得通过类似post,get等方式传入的数据。 2、getAttribute是返回对象,getParameter返回字符串。 3、getAttribute()一向是和setAttribute()一起使用的,只有先用setAttribute()设置之后,才能够通过getAttribute()来获得值,它们传递的是Object类型的数据。而且必须在同一个request对象中使用才有效。,而getParameter()是接收表单的...
2021-11-22 22:51:39
1493
原创 java中的this关键字
一、this关键字主要有三个应用: (1)this调用本类中的属性,也就是类中的成员变量; (2)this调用本类中的其他方法; (3)this调用本类中的其他构造方法,调用时要放在构造方法的首行。 Public Class One { String name; //定义一个成员变量name private void SetName(String name) { //定义一个参数(局部变量)name this.name=name; //将局部变量的name的值赋值给成员变量name.
2021-11-20 21:42:41
178
原创 设置日期时间
public class DataUntil { public static String getNow(){ Calendar c=Calendar.getInstance(); Format format=new SimpleDateFormat("YYYY-MM-dd hh:mm:ss"); return String.valueOf(format.format(c.getTime())); } }
2021-11-19 22:47:52
1945
原创 JSP新增页面的非空验证
JSP页面 <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> <script type="text/javascript" src="js/jquery-2.1.0.js" ></script> <script type="text/ja
2021-11-17 22:43:16
1004
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人