Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于跑不起来的问题 #6

Open
Newbie595 opened this issue Dec 8, 2019 · 9 comments
Open

关于跑不起来的问题 #6

Newbie595 opened this issue Dec 8, 2019 · 9 comments

Comments

@Newbie595
Copy link

emm大佬在吗,
问题一:导入idea后,跑不起来 例如
` @OverRide
public void init(FilterConfig filterConfig) throws ServletException {

}

@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
    servletRequest.setCharacterEncoding("UTF-8");
    filterChain.doFilter(servletRequest,servletResponse);
    servletResponse.setCharacterEncoding("UTF-8");
    Date begin = new Date();
    begin.getTime();
}`

里边的override就报错了 ,显示红色 提示信息为:方法并没有override其超类。。。
问题二:我在里面好像没发现大佬用引用jar,是我看漏了,还是啥呀?请大佬赐教呀嘻嘻

@GongShengyue
Copy link
Owner

我的没问题啊,你是不是导入步骤不对

@Newbie595
Copy link
Author

emm,导入的步骤是怎么样的,嘻嘻有qq方便联系一下吗?or 微信

@Newbie595
Copy link
Author

前几天我学习web的案例项目时 是直接创一个项目 ,然后复制老师的src和web文件夹 覆盖到我新 创的项目里,这样也能跑得起来

@Newbie595
Copy link
Author

package cn.ylcto.book.DAO.impl;

import cn.ylcto.book.DAO.ILenbookDAO;
import cn.ylcto.book.vo.Lenbook;
import cn.ylcto.util.test.AbstractDAOImpl;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.List;
import java.util.Set;

public class LenbookDAOimpl extends AbstractDAOImpl implements ILenbookDAO{
    public LenbookDAOimpl(Connection conn) {
        super(conn);
    }

    @Override
    public boolean doCreate(Lenbook vo) throws SQLException {
        String sql = "INSERT INTO lenbook(bid,mid,credate) VALUES(?,?,?)";
        super.pstmt = super.conn.prepareStatement(sql);
        super.pstmt.setInt(1,vo.getBooks().getBid());
        super.pstmt.setString(2,vo.getMenmber().getMid );
        super.pstmt.setTimestamp(3,new Timestamp(vo.getCredate().getTime()));

        return super.pstmt.executeUpdate()>0;
    }

请问这份代码是干嘛用的,他也是显示getMenmber().红色
emmm

@GongShengyue
Copy link
Owner

package cn.ylcto.book.DAO.impl;

import cn.ylcto.book.DAO.ILenbookDAO;
import cn.ylcto.book.vo.Lenbook;
import cn.ylcto.util.test.AbstractDAOImpl;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.List;
import java.util.Set;

public class LenbookDAOimpl extends AbstractDAOImpl implements ILenbookDAO{
    public LenbookDAOimpl(Connection conn) {
        super(conn);
    }

    @Override
    public boolean doCreate(Lenbook vo) throws SQLException {
        String sql = "INSERT INTO lenbook(bid,mid,credate) VALUES(?,?,?)";
        super.pstmt = super.conn.prepareStatement(sql);
        super.pstmt.setInt(1,vo.getBooks().getBid());
        super.pstmt.setString(2,vo.getMenmber().getMid );
        super.pstmt.setTimestamp(3,new Timestamp(vo.getCredate().getTime()));

        return super.pstmt.executeUpdate()>0;
    }

请问这份代码是干嘛用的,他也是显示getMenmber().红色

emmm

代码写错了,是getMember(),我已经修改了。

@GongShengyue
Copy link
Owner

GongShengyue commented Jan 4, 2020 via email

@KoishiForever
Copy link

大佬解决了吗,我也碰到一样的问题,也是这段代码的@OverRide报错,方法不会覆盖或实现超类型的方法

@1498610052
Copy link

大佬解决了吗,我也碰到一样的问题,也是这段代码的@OverRide报错,方法不会覆盖或实现超类型的方法

我也是同样的问题

@forst-creat
Copy link

forst-creat commented Oct 12, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants