org.postgresql.util.PSQLException: ERROR: column "feedbackid" does not exist Position: 8PSQLException:錯誤:列不存在位置:8
我收到此錯誤但無法理解背後的原因。 它顯示: - **
org.postgresql.util.PSQLException: ERROR: column "feedbackid" does not exist Hint: Perhaps you meant to reference the column "feedback.feedbackId". Position: 8
**
數據庫表中postgres的:
create table `company`.`feedback` (
feedbackId
INT(10)NOT NULL, feedbackActionId
INT(12)NOT NULL, description
varchar(200)DEFAULT NULL, feedbackText
varchar(2000)DEFAULT NULL, email
varchar(100)NOT NULL, createdDate
date NOT NULL );
public Feedback getFeedbackById(int id) throws SQLException, ClassNotFoundException {
conn = DBConnection.setDBConnection();
String sqlQuery = "select feedbackId, feedbackActionId, description, feedbackText, email, createdDate" +
"from feedback " +
" where feedbackId = " + id ;
DBConnection dbConn = new DBConnection();
ResultSet resultSet = dbConn.getResultSet(sqlQuery, conn);
int feedbackId = resultSet.getInt("feedbackId");
int feedbackActionId = resultSet.getInt("feedbackActionId");
String description = resultSet.getString("description");
String feedbackText = resultSet.getString("feedbackText");
String email = resultSet.getString("email");
Date createdDate = resultSet.getDate("createdDate");
feedback = new Feedback(feedbackId, feedbackActionId, description, feedbackText, email, createdDate);
resultSet.close();
return feedback;
}
在此先感謝。
你可以在你的問題中包括你的反饋表架構嗎? –
列名 –
從「反饋」更改爲「來自反饋」後,缺少空格 –