This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MySQL服务器通过权限表来控制用户对数据库的访问,权限表存放在mysql数据库里,由mysql_install_db脚本初始化。这些权限表分别user,db,table_priv,columns_priv和host。下面分别介绍一下这些表的结构和内容: | |
user权限表:记录允许连接到服务器的用户帐号信息,里面的权限是全局级的。 | |
db权限表:记录各个帐号在各个数据库上的操作权限。 | |
table_priv权限表:记录数据表级的操作权限。 | |
columns_priv权限表:记录数据列级的操作权限。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
数据库三大范式: | |
1、第一范式:每个列都不可以再拆分。 | |
依据设计目标,该字段不可分割,第一范式是关系数据库的基础。 | |
2、第二范式:在第一范式的基础上,非主键列完全依赖于主键,而不能是依赖于主键的一部分。 | |
需要主键的原因:因为主键有唯一性,有了主键就可以定位到这条记录 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JDBC API 允许用户访问任何形式的表格数据,尤其是存储在关系数据库中的数据。 | |
执行流程: | |
1、连接数据源,如:数据库。 | |
2、为数据库传递查询和更新指令。 | |
3、处理数据库响应并返回的结果。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
常用端口号与对应的服务以及端口关闭 | |
21端口:21端口主要用于FTP(File Transfer Protocol,文件传输协议)服务。 | |
23端口:23端口主要用于Telnet(远程登录)服务,是Internet上普遍采用的登录和仿真程序。 | |
25端口:25端口为SMTP(Simple Mail Transfer Protocol,简单邮件传输协议)服务器所开放,主要用于发送邮件,如今绝大多数邮件服务器都使用该协议。 | |
53端口:53端口为DNS(Domain Name Server,域名服务器)服务器所开放,主要用于域名解析,DNS服务在NT系统中使用的最为广泛。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TCP和UDP是OSI模型中的运输层中的协议。TCP提供可靠的通信传输,而UDP则常被用于让广播和细节控制交给应用的通信传输。 | |
1、UDP(User Datagram Protocol) //关键词: 无控制机制 原样发送 面向无连接 无法进行流量控制 不可靠 面向报文 对实时应用很有用 支持多对多 首部开销只有8个字节 数据传输快 | |
UDP不提供复杂的控制机制,利用IP提供面向无连接的通信服务。并且它是将应用程序发来的数据在收到的那一刻,立刻按照原样发送到网络上的一种机制。 | |
即使是出现网络拥堵的情况下,UDP也无法进行流量控制等避免网络拥塞的行为。此外,传输途中如果出现了丢包,UDP也不负责重发。甚至当出现包的到达顺序乱掉时也没有纠正的功能。如果需要这些细节控制,那么不得不交给由采用UDP的应用程序去处理。换句话说,UDP将部分控制转移到应用程序去处理,自己却只提供作为传输层协议的最基本功能。UDP有点类似于用户说什么听什么的机制,但是需要用户充分考虑好上层协议类型并制作相应的应用程序。在多播与广播通信中也使用UDP。 | |
2、TCP(Transmission Control Protocol) //关键词: 顺序、重发控制 面向连接 可以控制通信流量 可靠 面向字节流 只支持点到点 首部开销高达20字节 数据传输慢 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
进程是资源分配的最小单位 | |
线程是CPU调度的最小单位 | |
一个进程可以有多个线程 | |
为什么要用线程: | |
线程在进程下行进(一个车厢无法运行) | |
一个进程可以包含多个线程(一辆火车可以有多个车厢) | |
不同进程间数据很难共享(一辆火车上的乘客很难换到另外一辆火车,比如站点换乘) | |
同一进程下不同线程间数据很易共享(A车厢换到B车厢很容易) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1、使用JQuery进行隐藏和显示 | |
<script src="https://how2j.cn/study/jquery.min.js"></script> | |
<script> | |
$(function(){ | |
$("#b1").click(function(){ | |
$("#d").hide(); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1、不使用tomcat访问html | |
不使用tomcat也可以打开html页面,但是可以在浏览器的地址里看到 file:d:/test.html 这样的格式,是通过打开本地文件的形式打开的 | |
但是我们平时上网看到的html网址一般都是: | |
http://12306.com/index.html 这样的形式 | |
这是因为有web服务器的存在。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1、时间原点概念 | |
零这个数字,就代表Java中的时间原点,其对应的日期是1970年1月1日 8点0分0秒 。 | |
所有的日期,都是以为这个0点为基准,每过一毫秒,就+1。 | |
2、创建日期对象 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.在外部调用静态方法时,可以使用"类名.方法名"的方式,也可以使用"对象名.方法名"的方式。而实例方法只有后面这种方式。也就是说,调用静态方法可以无需创建对象。 | |
2.静态方法在访问本类的成员时,只允许访问静态成员(即静态成员变量和静态方法),而不允许访问实例成员变量和实例方法,如果需要调用,则需要先实例化;实例方法则无此限制。 | |
3.概念分析 | |
静态方法是在类中使用staitc修饰的方法,在类定义的时候已经被装载和分配。而非静态方法是不加static关键字的方法,在类定义时没有占用内存,非静态方法只有在类被实例化成对象时,对象调用该方法才被分配内存; | |
**注:**允许不创建对象而调用静态方法,是Java为了减少程序员调用某些常用方法时的麻烦,而允许程序员按照传统的C语言中使用函数的方式来使用方法。典型的例子是使用"Math.ramdon()"来获取随机数。 | |
静态方法只能访问静态成员,实例方法可以访问静态和实例成员。之所以不允许静态方法访问实例成员变量,是因为实例成员变量是属于某个对象的,而静态方法在执行时,并不一定存在对象。同样,因为实例方法可以访问实例成员变量,如果允许静态方法调用实例方法,将间接地允许它使用实例成员变量,所以它也不能调用实例方法。基于同样的道理,静态方法中也不能使用关键字this。 |
NewerOlder