Markdown学习

前情提要

本次marker语法详解使用的是Typora,现在Typora开始收费了,博主有以前的版本,可以联系博主下载以前版本

所有的内容都是参照b站up主狂神说编程编写的(主讲java,感兴趣可以去b站看他的视频,超级推荐)

标题

三级标题

标题:# (空格)+标题名字(一级标题)

二级标题:## +标题名字

三级标题:### +标题名字

以此类推,到六级标题为止

字体

格式里有快捷键

变粗体(字体两边加两个*号)

hello world

变斜体(字体两边只加一个*号)

hello word

斜体加粗(字体两边加三个*号)

hello word


删除线(两边加两个波浪线)

hello word

引用

箭头符号>加空格就是引用 (摘抄别人的文章时需要用到)

戴戴的个人网站

分割线

有助于梳理文章

1、三个杠---


2、三个号***


图片

插图片:感叹号!加英文中括号[中括号里面写名字]后面加一个括号(括号里写地址)也可以写网络上图片的地址

超链接

英文的中括号[点击跳转到..]后面加英文括号(括号加地址)

点击跳转到我的博客

列表

排序:有序号的排序:1.空格回车就是2.了

无序排序减号空格(出现一个点)回车会有下一个点

  • A

表格

1.直接插入表格(右键,插入表格)

2.名字加竖杠|名字|名字|再右键

然后在下面写相应要填入的东西

姓名性别生日
张三2001-09-08

代码

三个点(tab键上三个点(英文模式下)加要写代码类型然后回车,比如```java

package dao;
​
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
​
import model.SelectedCourse;
​
/**
 * 
 * @author llq
 *选课数据库操作对象
 */
public class SelectedCourseDao extends BaseDao {
    public boolean addSelectedCourse(SelectedCourse selectedCourse){
        String sql = "insert into t_selected_course values(?,?)";
        try {
            java.sql.PreparedStatement preparedStatement = con.prepareStatement(sql);
            preparedStatement.setInt(1, selectedCourse.getStudent_id());
            preparedStatement.setInt(2, selectedCourse.getCourse_id());
            if(preparedStatement.executeUpdate() > 0)return true;
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return false;
    }
    public boolean updateSelectedCourse(SelectedCourse selectedCourse){
        String sql = "update s_selected_course set student_id = ?,course_id = ? where id = ?";
        try {
            java.sql.PreparedStatement preparedStatement = con.prepareStatement(sql);
            preparedStatement.setInt(1, selectedCourse.getStudent_id());
            preparedStatement.setInt(2, selectedCourse.getCourse_id());
            preparedStatement.setInt(3, selectedCourse.getId());
            if(preparedStatement.executeUpdate() > 0)return true;
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return false;
    }
    public List<SelectedCourse> getSelectedCourseList(SelectedCourse selectedCourse){
        List<SelectedCourse> retList = new ArrayList<SelectedCourse>();
        StringBuffer sqlString = new StringBuffer("select * from t_selected_course");
        if(selectedCourse.getStudent_id() != 0){
            sqlString.append(" and student_id = "+selectedCourse.getStudent_id());
        }
        if(selectedCourse.getCourse_id() != 0){
            sqlString.append(" and course_id ="+selectedCourse.getCourse_id());
        }
        try {
            PreparedStatement preparedStatement = con.prepareStatement(sqlString.toString().replaceFirst("and", "where"));
            ResultSet executeQuery = preparedStatement.executeQuery();
            while(executeQuery.next()){
                SelectedCourse sc = new SelectedCourse();
                sc.setId(executeQuery.getInt("id"));
                sc.setStudent_id(executeQuery.getInt("student_id"));
                sc.setCourse_id(executeQuery.getInt("course_id"));
                retList.add(sc);
            }
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return retList;
    }
    public boolean isSelected(SelectedCourse selectedCourse){
        String sql = "select * from t_selected_course where student_id=? and course_id = ?";
        try {
            PreparedStatement prst = con.prepareStatement(sql);//把sql语句传给数据库操作对象
            prst.setInt(1, selectedCourse.getStudent_id());
            prst.setInt(2, selectedCourse.getCourse_id());
            ResultSet executeQuery = prst.executeQuery();
            if(executeQuery.next()){
                return true;
            }
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return false;
    }
    public boolean delete(int id){
        String sql = "delete from t_selected_course where id=?";
        try {
            PreparedStatement preparedStatement = con.prepareStatement(sql);
            preparedStatement.setInt(1, id);
            if(preparedStatement.executeUpdate() > 0){
                return true;
            }
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return false;
    }
}
​

 

查看源代码

点击左下角的</>可查看源代码

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值