Skip to content

Commit edb0d03

Browse files
committed
update
1 parent 8a91aac commit edb0d03

33 files changed

+961
-23
lines changed

database/code/JDBC/.idea/workspace.xml

Lines changed: 65 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
114 Bytes
Binary file not shown.

database/code/JDBC/src/Test.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@ public class Test {
77
public static void main(String[] args) throws Exception{
88
Class.forName("com.mysql.jdbc.Driver");
99
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/db1","root","123456");
10-
PreparedStatement pstmt = conn.prepareStatement("insert into tblA(age,birth) values (?,?);");
11-
for (int i = 200000; i < 1000000; i++) {
12-
pstmt.setInt(1,i);
13-
pstmt.setDate(2,new Date(new java.util.Date().getTime()));
14-
pstmt.addBatch();
10+
PreparedStatement pstmt = conn.prepareStatement("insert into rental(rental_date,inventory_id,customer_id,return_date,staff_id,last_update) values (?,?,?,?,?,?);");
11+
for (int i = 200000; i < 5000000; i++) {
12+
pstmt.setDate(1,new Date(new java.util.Date().getTime()));
13+
pstmt.setInt(2,1);
14+
pstmt.setInt(3,1);
15+
pstmt.setDate(4,new Date(new java.util.Date().getTime()));
16+
pstmt.setInt(5,1);
17+
pstmt.setDate(6,new Date(new java.util.Date().getTime()));
18+
pstmt.execute();
1519
}
16-
pstmt.executeBatch();
1720
conn.close();
1821
}
1922
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
8+
<title>Document</title>
9+
</head>
10+
11+
<body>
12+
13+
</body>
14+
15+
</html>
16+
<script>
17+
//在JS当中数组使用[]进行表示
18+
//JS当中数组是引用类型数据
19+
console.log([]);
20+
console.log(typeof []);
21+
//数组目的:可以一次性存储很多有序数据
22+
console.log([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
23+
</script>
24+
<script>
25+
//为了在JS当中使用数组方便
26+
//经常将右侧数组赋值给左侧变量(通过变量名字可以访问存储数组)
27+
28+
//存储数据
29+
var arr = ["我爱你祖国", 12306, true, NaN, [2, 3, 4]];
30+
31+
//为了读取数据:通过枚举法 + 下角标(索引值)获取数组里面存储数据
32+
console.log(arr[0]);
33+
console.log(arr[3]);
34+
console.log(arr[4]);
35+
//修改数组里面数据
36+
arr[0] = "我爱你母亲";
37+
arr[1] = 110;
38+
arr[4][0] = 66666;
39+
console.log(arr);
40+
//新增数据
41+
arr[5] = "我是后来的";
42+
arr[6] = "稍等我也来了";
43+
arr[9999] = "我是老嘎达";
44+
console.log(arr);
45+
console.log(arr[100]);
46+
</script>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
8+
<title>Document</title>
9+
</head>
10+
11+
<body>
12+
13+
</body>
14+
15+
</html>
16+
<script>
17+
//length属性:可以获取数组里面元素总个数
18+
var arr = ["吃饭", "睡觉", "打豆豆", "喝酒", "烫头"];
19+
//数组里面一共是五个元素
20+
console.log(arr.length);
21+
//数组里面元素是从零开始的
22+
//数组的length属性常用语遍历数组
23+
for (var i = 0; i < arr.length; i++) {
24+
//获取数组里面元素
25+
console.log(arr[i]);
26+
}
27+
</script>
28+
<script>
29+
//数组常见算法题:
30+
//比如:计算数组里面元素累加和问题
31+
var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
32+
var sum = 0;
33+
for (var i = 0; i < arr.length; i++) {
34+
sum += arr[i];
35+
}
36+
//计算完毕获取结果
37+
console.log(sum);
38+
</script>
39+
<script>
40+
//获取数组里面最大元素
41+
var arr = [66, 3, 2, 99, 26, 21, 19, 88];
42+
//获取最大数字
43+
var max = arr[0];
44+
for (var i = 0; i < arr.length; i++) {
45+
//后者元素大于前者进行重新赋值
46+
if (arr[i] > max) {
47+
max = arr[i];
48+
}
49+
}
50+
console.log(max);
51+
</script>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
8+
<title>Document</title>
9+
</head>
10+
11+
<body>
12+
13+
</body>
14+
15+
</html>
16+
<script>
17+
//声明数组
18+
var arr = ["幺鸡", "五万", "三饼", "二条", "二筒", "发财"];
19+
//pop:是数组的一个方法,主要的作用是可以在数组尾巴出移除 一项元素
20+
// var result = arr.pop();
21+
// var result1 = arr.pop();
22+
// console.log(arr);
23+
// console.log(result);
24+
// console.log(result1);
25+
//push:是数组方法,主要的作用是可以向数组 添加一个、多个元素
26+
var result = arr.push("曹操");
27+
var result1 = arr.push("刘备", "关二爷", "张飞");
28+
console.log(arr);
29+
console.log(result);
30+
console.log(result1)
31+
</script>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
8+
<title>Document</title>
9+
</head>
10+
11+
<body>
12+
13+
</body>
14+
15+
</html>
16+
<script>
17+
//shift:在数组头部删除一项元素
18+
var arr = ["北京", "上海", "广州", "深圳"];
19+
//头部删除一项元素
20+
// var result = arr.shift();
21+
// console.log(arr);
22+
// console.log(result);
23+
24+
//头部添加一个、多个元素
25+
var result = arr.unshift("杭州", "苏州", "小米粥");
26+
console.log(arr);
27+
console.log(result);
28+
</script>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=, initial-scale=1.0">
7+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
8+
<title>Document</title>
9+
</head>
10+
11+
<body>
12+
13+
</body>
14+
15+
</html>
16+
<script>
17+
//reverse:数组方法让数组元素进行倒置
18+
var arr = ["香港港独", 1, 2, 3, 4, 5, "香蕉", "香蕉", "香蕉", "最近广厦事件"];
19+
// arr.reverse();
20+
// console.log(arr);
21+
//indexOf:可以检测某一个元素索引值
22+
console.log(arr.indexOf("香蕉"));
23+
console.log(arr.indexOf("贾成豪"));
24+
console.log(arr.valueOf());
25+
</script>

0 commit comments

Comments
 (0)