2011-01-14 2 views
0

나는 (테이블 모델에서 데이터 소스로 jdbc를 사용하는) 다음과 비슷한 것을하고 싶다. 그러나 최대 절전 모드를 사용하고있다. 어떻게하면 좋을까요? 감사JTable 모델의 데이터 소스로 hibernate를 사용하는 방법

// Table Model 
    import javax.swing.table.AbstractTableModel; 
    import java.sql.*; 
    import java.util.Vector; 

    public class MyTableModel extends AbstractTableModel { 

    Connection myConnect; // Hold the JDBC Connection 
    Statement myStatement; // Will contain the SQL statement 
    ResultSet myResultSet; // Contains the result of my SQL statement 

답변

0

당신은 같은 것을 수행 할 수 있습니다

public class MyTableModel extends AbstractTableModel { 
    Session mySession; // Hibernate Session, used to run queries 
    String myHQL; // Will contain the HQL statement 
    List<?> myResult; // Contains the result of my HQL statement 

희망 나는 당신이 질문을 이해할 수 있습니다.

+0

답변 해 주셔서 감사합니다. 그 트릭을 할 수도 있습니다. – kochu

관련 문제