(Float)

java.lang.Integer cannot be cast to java.lang.Float  

 

형이 맞지 않아 오류가 나는 부분입니다.

 

java단에 형변환이 안맞거나, db에서 불러올때 맞지 않아 오류가 난부분입니다.

(Float)queryForObject("countDi11", baseDto, Float.class);<-- float 형으로 받게 해놨지만

<select id="countDi11"  resultType="Integer"> <--결과값형이 int형이였기 때문이다.

두 부분의 형을 맞추어주어야 한다.

 

 

<select id="countDi11"  resultType="Float"> <!-- true

jni shared library 

해당 오류가 뜨는 이윤 서로 비트가 다르기 때문입니다.

모든 비트는 동일하여야 정상작동합니다.

출처 : Some resources were not updated.
svn: E155017: Checksum mismatch while updating 

 

[Eclipse]svn Checksum mismatch for .. 에러

여태껏 잘되던 커밋을 하는데................. 갑자기 에러 발생.. "svn Checksum mismatch for ...

blog.naver.com

 



1. Eclipse - Project Explorer 에서 충돌난 파일이 있는 폴더를 찾는다.

2. 마우스 우클릭 - [Team] - [CleanUp]

3. 윈도우 탐색기를 열어 충돌난 파일의 폴더로 이동한다.

4. 찾은 폴더명을 변경한다. (ex. xxx_bak)

5. Eclipse 로 돌아와 해당 폴더를 UPDATE 받는다.

6. 새로 받은 파일의 이상 유무 파악 후 이상이 없다면 xxx_bak 폴더를 삭제한다.

 

 

java.sql.SQLException: Operation not allowed after ResultSet closed


에러 발생~ !!


하나의 Statement에 대해 하나의 ResultSet이 유효합니다. 


아래 참고~하였습니다.

public static void main(String[] args) throws ClassNotFoundException, SQLException {

    Connection conn = null;
    Statement stmt = null;

    Class.forName("com.mysql.jdbc.Driver");

    conn = (Connection) DriverManager.getConnection(DB_URL, USER, PASS);

    stmt = (Statement) conn.createStatement();
    String sql;
    ResultSet rs = null;
    ResultSet rs2 = null;
    ResultSet rs3 = null;
    java.sql.PreparedStatement ps = null;
    int event_id = 10;
    sql = "SELECT id,text from tweet where event_id = " + event_id;
    rs = stmt.executeQuery(sql);

    String text = "";
    Long id;
    while (rs.next()) {
        id = rs.getLong("id");
        text = rs.getString("text");
        System.out.println("tweet = " + text);
        text = text.replaceAll("http[^\\s]+", "");
        text = text.replaceAll("www[^\\s]+", "");
        System.out.println("tweet after removal of links= " + text);

        StringTokenizer st = new StringTokenizer(text);
        while (st.hasMoreTokens()) {
            String stopword = st.nextToken();
            System.out.println("stopword : " + stopword);

            sql = "SELECT * from stopwords WHERE word =" + '"'+stopword+'"';

            Statement stmt2 = conn.createStatement();
            rs2 = stmt2.executeQuery(sql);
            if (rs2.next()) {
                text = text.replaceAll(stopword, "");
                System.out.println("tweet after removing stopword = " + text);
            }
            sql = "SELECT * from filtertweet where tweet_id = " + id + "";

            Statement stmt3 = conn.createStatement();
            rs3 = stmt3.executeQuery(sql);
            if (!rs3.next()) {
                sql = "INSERT INTO filtertweet VALUES(?,?)";
                ps = conn.prepareStatement(sql);
                ps.setLong(1, id);
                ps.setString(2, text);
                ps.executeUpdate();
            }

        }
    }
    stmt.close();
    conn.close();
}


출처

+ Recent posts