会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 133929个问题

一、压缩文件

mapperdemo.zip

二、报错截图,老师帮我看一下这怎么弄

blob.png

JAVA 全系列/第六阶段:项目管理与SSM框架/Mybatis 23328楼

ssm_rbac.zip

log.txt

这个项目视频里是在eclipse上运行的,我在idea上试了一直报错,应该和tomcat服务器有点关系

老师有空能远程给我看看嘛

JAVA 全系列/第六阶段:项目管理与SSM框架/RBAC实战 23329楼

log.txt

这边连接数据库一直不成功,这个报错信息也看不懂

项目我就不发了就是老师给的样例

JAVA 全系列/第十阶段:权限控制与安全认证/Shiro(旧) 23330楼
JAVA 全系列/第六阶段:项目管理与SSM框架/Mybatis 23335楼
JAVA 全系列/第十八阶段:亿级高并发电商项目_架构/编码(旧)/电商:使用Solr实现数据搜索 23336楼

<div class="white-nav">
    <div class="white-nav-bar">
        <div class="bar-left">
            <a href="#">
                <img  class="mi-logo"src="images/mi-logo.png" alt="">
                <img  class="mi-home" src="images/mi-home.png" alt="">
            </a>
        </div>
        <div class="bar-center">
            <ul>
                <li><a href="#">小米手机
                <div class="list">
                    <div class="list-center">
        <ul>
            <li>
                <a href="#"><div class="img-box"><img src="images/3b19bf0e7e599c1bbbce510fb0dbc8bc.jpg" alt="">
                </div>
                    <p class="name1">小米10S</p>
                    <p class="price1">3299元起</p></a>
            </li>
            <li><a href="#"><div class="img-box"><img src="images/3b19bf0e7e599c1bbbce510fb0dbc8bc.jpg" alt="">
            </div>
                <p class="name1">小米10S</p>
                <p class="price1">3299元起</p></a></li>
            <li><a href="#"><div class="img-box"><img src="images/3b19bf0e7e599c1bbbce510fb0dbc8bc.jpg" alt="">
            </div>
                <p class="name1">小米10S</p>
                <p class="price1">3299元起</p></a></li>
            <li><a href="#"><div class="img-box"><img src="images/3b19bf0e7e599c1bbbce510fb0dbc8bc.jpg" alt="">
            </div>
                <p class="name1">小米10S</p>
                <p class="price1">3299元起</p></a></li>
            <li><a href="#"><div class="img-box"><img src="images/3b19bf0e7e599c1bbbce510fb0dbc8bc.jpg" alt="">
            </div>
                <p class="name1">小米10S</p>
                <p class="price1">3299元起</p></a></li>
            <li class="last-list"><a href="#"><div class="img-box"><img src="images/3b19bf0e7e599c1bbbce510fb0dbc8bc.jpg" alt="">
            </div>
                <p class="name1">小米10S</p>
                <p class="price1">3299元起</p></a>
            </li>
        </ul>
    </div>
    </div>
                </a></li>
.white-nav{
    width: 1423px;
    height: 100px;
    background-color: #ffffff;
    position: relative;

}
.white-nav-bar{
    width: 1226px;
    height: 100%;
    margin: 0 auto;
}
.bar-left{
    width: 55px;
    height: 55px;
    background-color: #ff6700;
    margin-top: 22.5px;
    float:left;
    position: relative;
    overflow: hidden;

}
.bar-center{
    width: 875px;
    height: 100%;
    float: left;
    line-height: 100px;

}
.bar-right{
    height: 100px;
    width: 296px;
    position: relative;
    float: left;
}
.bar-center>ul{
    margin-left: 179px;

}
.bar-center li{
    padding: 0 10px;
    float: left;


}
.bar-center>ul>li>a{
    color: #333333;
}
.bar-center>ul>li>a:hover{
    color: #ff6700;
}
.mi-home{
    width: 100%;
    position: absolute;
    top: 0;
    left: 100%;
}
.mi-logo{
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
}
.bar-left:hover .mi-logo{
    left: -100%;
}
.bar-left:hover .mi-home{
    left: 0;
}
.bar-left img{
    transition: all .2s;
}
.list{
    width: 1423px;
    height: 0;
    background-color: #fff;
    position: absolute;
    left: 40px;
    top: 100px;
    box-shadow: 0 3px 4px rgba(0,0,0,.2);
    transition: all .2s;
    overflow: hidden;
    float: left;



}
.list-center{
    width: 1226px;
    height: 100%;
    position: absolute;
    left: 50%;
    margin-left: -613px;
    float: left;
}
.list-center li{
    width: 204px;
    padding: 0;
}
.img-box{
    width: 100%;
    height: 110px;
    border-right: 1px solid #eee;
    box-sizing: border-box;
    margin-top: 35px;
    margin-bottom: 16px;
}
.img-box img{
    height: 100%;
}
.list-center p{
    font-size: 12px;
    line-height: 20px;
}
.last-list .img-box{
  border-right: none ;
}
.name1{
    color: #333;
}
.price1{
    color: #ff6700;
}
.bar-center li:hover .list{
    height: 229px;
    border-top: 1px solid rgba(224,224,224,.6);

}
.bar-right{
    height: 100px;
    position: relative;
}
.bar-right input{
    width: 244px;
    height: 50px;
    border: 1px solid #e0e0e0;
    padding: 0 10px;
    box-sizing: border-box;
    outline: none;
    float: left;
    border-right: none;
    margin-top: 25px;

}
.bar-right>button{
    width: 52px;
    height: 50px;
    border: 1px solid #e0e0e0;
    background-color: #fff;
    float: left;
    margin-top: 25px;

}
.bar-right input:focus{
    border-color: #ff6700;
}
.bar-right input:focus~.iconfont{
    border-color: #ff6700;
}
.bar-right>button:hover{
    background-color: #ff6700;
    color: #fff;
}

.text-list{
    width: 243px;
    height: 0;
    border-top: none;
    position: absolute;
    top: 75px;
    left: 0;
    z-index: 990;
    background-color: #fff;
}
.bar-right input:focus+.text-list{
    height: 240px;
    border: 1px solid #ff6700;
    border-top: none;
}

老师我想问问为什么我的list显示不了100%的宽度

WEB前端全系列/第一阶段:HTML5+CSS3模块/CSS3新特性 23337楼

package com.cx;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;

/**
 * 使用封装工具
 */
public class jdbcTest2 {
    //向Department表中添加一条数据
    public void insertDeparments(String department_name,int location_id){
        Connection conn = null;
        Statement state = null;
        try {
            //使用封装工具
            conn = jdbcUtil1.getConnection();

            String sql="insert into departments values(default,'"+department_name+"',"+location_id+")";
            state = conn.createStatement();   //通过conn对象调用Connection接口下createStatement方法
            int flag = state.executeUpdate(sql);
            System.out.println(flag);
        } catch (Exception e) {
            e.printStackTrace();
        }finally {
            jdbcUtil1.closeConnection(conn);
            jdbcUtil1.closeStatment(state);
        }
    }
    //更新departments表中的department_id为6的数据,将部门名称修改为教学不,location_id修改为6
    public  void  updateDepartments(String department_name,int location_id,int department_id){
        Connection conn = null;
        Statement state = null;
        try {
            conn= jdbcUtil1.getConnection();
            state = conn.createStatement();
            String sql = "update departments d set d.department_name = '"+department_name+"',d.location_id ="+location_id+" where d.department_id ="+department_id+"";
            int flag = state.executeUpdate(sql);
            System.out.println(flag);
        }catch (Exception e){
            e.printStackTrace();
        }finally {
            jdbcUtil1.closeConnection(conn);
            jdbcUtil1.closeStatment(state);
        }
    }
    //查询Departments表中部门ID为6的部门信息
    public void selectDepartmentsById(int departmentId){
        Connection conn = null;
        Statement state = null;
        ResultSet rs = null;
        try {
            conn = jdbcUtil1.getConnection();
            state = conn.createStatement();
            String sql = "select * from departments d where d.department_id = "+departmentId;
            //执行查询返回结果
            rs = state.executeQuery(sql);
            while (rs.next()){
                int a = rs.getInt("department_id");
                String s = rs.getString("department_name");
                int b = rs.getInt(3);
                System.out.println(a+" "+s+" "+b);
            }
        }catch (Exception e){
            e.printStackTrace();
        }finally {
            jdbcUtil1.closeConnection(conn);
            jdbcUtil1.closeStatment(state);
            jdbcUtil1.closeResultSet(rs);
        }
    }

    public static void main(String[] args) {
        jdbcTest2 test2 = new jdbcTest2();
        //test.insertDeparments("工程部",6);
       // test.updateDepartments("研发",6,8);
        test2.selectDepartmentsById(6);
    }
   
}
package com.cx;


import java.sql.*;
import java.util.ResourceBundle;

/**
 * 封装jdbc工具类
 */
public class jdbcUtil1 {
    private static String driver;
    private static String jdbcUrl;
    private static String username;
    private static String userpassword;
    static {
        ResourceBundle bundle = ResourceBundle.getBundle("jdbc");
        driver=bundle.getString("driver");
        jdbcUrl= bundle.getString("jdbcUrl");
        username=bundle.getString("username");
        userpassword=bundle.getString("userpassword");
        try {
            Class.forName(driver);
        }catch (Exception e){
            e.printStackTrace();
        }
    }
    //获取Connection对象
    public static Connection getConnection() {
        Connection conn = null;
        try {
            //获取连接
            conn = DriverManager.getConnection(jdbcUrl,username,userpassword);
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return conn;
    }
    //关闭Statement
    public static void closeStatment(Statement state){
        try {
            if (state != null){
                state.close();
            }
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
    }
    //关闭Connection
    public static void closeConnection(Connection conn){
        try {
            if (conn != null){
                conn.close();
            }
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
    }
    //关闭
    public  static void closeResultSet(ResultSet rs){
        try {
            if (rs != null){
                rs.close();
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
driver="com.mysql.jdbc.Driver"
jdbcUrl ="jdbc:mysql://localhost:3306/caixx?useUnicode=true&usecharacterEncoding=utf-8&useSSL=false"
username="root"
userpassword="root"


发现使用properties就会报错

image.png


不使用properties就正常, IDEA到底如何使用这个?

JAVA 全系列/第四阶段:数据库与AI协同技术实战/JDBC技术(旧) 23338楼
Python 全系列/第二阶段:Python 深入与提高/GUI编程(隐藏) 23339楼
JAVA 全系列/第二阶段:JAVA 基础深化和提高/XML 技术(旧) 23340楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园
网站维护:百战汇智(北京)科技有限公司
京公网安备 11011402011233号    京ICP备18060230号-3    营业执照    经营许可证:京B2-20212637