Closed. This question needs details or clarity。它当前不接受答案。
                            
                        
                    
                
                            
                                
                
                        
                            
                        
                    
                        
                            想改善这个问题吗?添加详细信息并通过editing this post阐明问题。
                        
                        上个月关闭。
                                                                                            
                
        
在给定图像中获取Reminder1的最后日期的Java代码是什么。 java - 从数据库中获取数据的Java代码是什么-LMLPHP

这是我写的,但是错了

StringBuffer sql = new StringBuffer("SELECT * FROM TITAN_PORTAL.Scorecard_Reminder whereStatus='Active'");
        resultSet = stmt.executeQuery(sql.toString());
        while (resultSet.next()) {
            String reminder1 = resultSet.getString("Reminder1.Last_Date");

最佳答案

使用表alias。以便更轻松地检索列名。

StringBuffer sql = new StringBuffer("SELECT * FROM TITAN_PORTAL.Scorecard_Reminder t1 whereStatus='Active'");
resultSet = stmt.executeQuery(sql.toString());
    while (resultSet.next()) {
        String reminder1 = resultSet.getString("t1.Last_Date");

09-26 20:02
查看更多