java.sql.SQLException: ORA-00942: 表或视图不存在

从eclipse转idea几天时间,纪念一次报错,连接orcal数据库时连接都没问题,

jdbc.driver=oracle.jdbc.driver.OracleDriver
jdbc.url=jdbc:oracle:thin:@localhost:1521:orcl
jdbc.username=SCOTT
jdbc.password=tiger

但是就是报错找不到表
自己写了一个测试类都能找到,通过mybatis就找不到
测试类代码

public class testJdbc {

    public static void main(String[] args) {
        ResultSet rs = null;
        Statement stmt = null;
        Connection conn = null;
        try {
            Class.forName("oracle.jdbc.driver.OracleDriver");
            String dbURL = "jdbc:oracle:thin:@localhost:1521:orcl";
            conn = DriverManager.getConnection(dbURL, "SCOTT", "tiger");
            stmt = conn.createStatement();
            System.out.println("连接成功");
            rs = stmt.executeQuery("SELECT * FROM user_t") ;
            while(rs.next()){
                String id = rs.getString("id");
                String name = rs.getString("name");
                String age = rs.getString("password");
                System.out.println(id+name+age);
            }

        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            try {
                if (rs != null) {
                    rs.close();
                    rs = null;
                }
                if (stmt != null) {
                    stmt.close();
                    stmt = null;
                }
                if (conn != null) {
                    conn.close();
                    conn = null;
                }
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
    }
}

最后发现问题原因是dao的maven没有clean。。。瞬间崩溃,搞了一下午,竟然因为这个
java.sql.SQLException: ORA-00942: 表或视图不存在_第1张图片

你可能感兴趣的:(jdbc,mybatis)