- 博客(22)
- 收藏
- 关注
原创 数据库常用命令
SHOW CREATE DATABASE school -- 查看创建数据库的语句SHOW CREATE TABLE student -- 查看student 数据表的定义语句DESC student -- 显示表的结构
2021-06-08 13:09:49
110
原创 创建数据库表
CREATE TABLE IF NOT EXISTS `student` ( `id` INT(4) NOT NULL AUTO_INCREMENT COMMENT '学号', `name` VARCHAR(30) NOT NULL DEFAULT '匿名' COMMENT '姓名', `pwd` VARCHAR(20) NOT NULL DEFAULT '123455' COMMENT '密码', `sex` VARCHAR(2) NOT NULL DEFAULT...
2021-06-08 13:06:30
163
原创 数据库的创建
CREATE DATABASE IF NOT EXISTS westos;DROP DATABASE IF EXISTS westos;-- TAB键的上面,如果你的表名或者字段名是一个特殊字符,就需要```student``student``student``school``school``student`USE `SCHOOL`;SELECT `user` FROM student;-- --查看所有的数据库SHOW DATABASES;DROP DATABASE IF EXISTS s
2021-06-08 12:39:44
96
原创 数据库里面的怎删改查
CREATE DATABASE IF NOT EXISTS westos;DROP DATABASE IF EXISTS westos;-- TAB键的上面,如果你的表名或者字段名是一个特殊字符,就需要```student``student``student``school``school``student`USE `SCHOOL`;SELECT `user` FROM student;SHOW DATABASES --查看所有的数据库...
2021-06-07 09:57:47
89
转载 2021-06-03 当数据库Enter password:ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘localhost:3306‘
[mysqld]# 设置3306端口port=3306# 设置mysql的安装目录basedir=E:\\software\\mysql\\mysql-8.0.11-winx64 # 切记此处一定要用双斜杠\\,单斜杠我这里会出错,不过看别人的教程,有的是单斜杠。自己尝试吧# 设置mysql数据库的数据的存放目录datadir=E:\\software\\mysql\\mysql-8.0.11-winx64\\Data # 此处同上# 允许最大连接数max_connection...
2021-06-03 21:56:28
384
原创 class加载器
package com.kuang.reflection;public class Test07 { public static void main(String[] args) throws ClassNotFoundException { //获取系统类的加载器 ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader(); System.out.println(syst.
2021-05-31 13:38:34
66
原创 注解Annotation外部注解
package com.kuang.annotation;import java.lang.annotation.ElementType;import java.lang.annotation.Retention;import java.lang.annotation.RetentionPolicy;import java.lang.annotation.Target;//自定义注解public class Test03 { //注解可以显式赋值,如果没有默认值,我们就必须给注解赋.
2021-05-31 08:22:15
85
Java的密码框
public class TestTextDemo03 extends JFrame { public TestTextDemo03(){ Container container = this.getContentPane(); JPasswordField passwordField = new JPasswordField();//*** passwordField.setEchoChar('*'); container.add(.
2021-05-27 22:24:46
482
原创 Java列表框
public class TestComboxDemo02 extends JFrame { public TestComboxDemo02(){ Container container = this.getContentPane(); //生成列表的内容 //String[] contests = {"1","2","3"}; //例表中需要放入内容 Vector contest = new Vector(); .
2021-05-27 21:42:37
161
原创 Java实现复选框
public class JButtonDemo03 extends JFrame{ public JButtonDemo03() { Container container = this.getContentPane(); //将一个图片变为图标 URL resource = JButtonDemo01.class.getResource("tx.jpg"); Icon icon = new ImageIcon(resource);.
2021-05-27 21:25:18
886
Java实现单选框
public class JButtonDemo02 extends JFrame { public JButtonDemo02() { Container container = this.getContentPane(); //将一个图片变为图标 URL resource = JButtonDemo01.class.getResource("tx.jpg"); Icon icon = new ImageIcon(resource).
2021-05-27 21:17:27
1698
原创 2021-05-27
图标,需要实现类public class IconDemo extends JFrame implements Icon { private int width; private int height; public IconDemo(){}//无参构造 public IconDemo(int width,int height){ this.width = width; this.height = height; } p
2021-05-27 16:35:21
47
原创 2021-05-27
弹窗public class DialogDemo extends JFrame { public DialogDemo() { this.setVisible(true); this.setSize(700,500); this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); //JFrame 放东西容器 Container container
2021-05-27 15:25:09
60
原创 2021-05-27
标签居中public class JFrameDemo02 { public static void main(String[] args) { new MyJframe2().init(); }}class MyJframe2 extends JFrame { public void init(){ this.setBounds(10,10,200,300); this.setVisible(true); J
2021-05-27 08:44:29
76
原创 2021-05-27
窗口监听:public class TestWindow { public static void main(String[] args) { new WindowFrame(); }}class WindowFrame extends Frame{ public WindowFrame(){ setBackground(Color.BLUE); setBounds(100,100,200,200);
2021-05-27 07:58:33
62
原创 2021-05-26
鼠标监听public class TestMouseListener { public static void main(String[] args) { new MyFrame("画图"); }}//自己的类class MyFrame extends Frame{ //画画需要画笔,需要监听鼠标当前位置,需要集合来存储这个点 ArrayList points; public MyFrame(String title) {
2021-05-26 23:20:01
71
原创 2021-05-26
画笔public class TestPaint { public static void main(String[] args) { new MyPaint().loadFrame(); }}class MyPaint extends Frame { public void loadFrame() { setBounds(200,200,600,500); setVisible(true); } @Overr
2021-05-26 22:37:08
54
原创 2021-05-26
简易加法计算器public class TestCalc { public static void main(String[] args) { new Calculator(); }}//计算器类class Calculator extends Frame { public Calculator() { //3个文本框 TextField num1 = new TextField(10); TextFiel
2021-05-26 22:06:50
50
原创 2021-05-26
监听文本输入public class TestText01 { public static void main(String[] args) { //启动 new MyFrame(); }}class MyFrame extends Frame { public MyFrame() { TextField textField = new TextField(); add(textField);
2021-05-26 14:06:27
57
原创 2021-05-26
事件监听:当按钮按下,触发一系列结果public class TestActionEvent { public static void main(String[] args) { //按下按钮,触发一些事件 Frame frame = new Frame(); Button button = new Button(); MyActionListener myActionListener = new MyActionListener
2021-05-26 13:31:44
47
原创 2021-05-25
发送端:public static void main(String[] args)throws Exception { DatagramSocket socket = new DatagramSocket(8888); //准备数据;控制台读取System.in BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); while(true) { St.
2021-05-25 14:04:20
111
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人