我想更新JTable
没有AES_ENCRYPT
可以更新和查看数据的数据,但是由于每次我尝试调用此方法时数据都是加密的,因此数据仍然是加密的。我该如何解决这个问题?
private void Update_Table(){
try{
String sql = "SELECT ID, AES_DECRYPT(FirstName, 'uk112') "
+ "AS FirstName, AES_DECRYPT( MiddleName, 'uk112') "
+ "AS MiddleName, AES_DECRYPT(LastName, 'uk112') "
+ "AS LastName, DOB, AES_DECRYPT(Gander, 'uk112')"
+ "AS Gander, AES_DECRYPT(Address, 'uk112')"
+ "AS Address, AES_DECRYPT(City, 'uk112' ) "
+ "AS City, AES_DECRYPT(PostCode, 'uk112')"
+ "AS PostCode FROM Customer";
pst = conn.prepareStatement(sql);
rs =pst.executeQuery(sql);
CTable.setModel(DbUtils.resultSetToTableModel(rs));
pst.close();
rs.close();
}
catch(Exception e){
JOptionPane.showMessageDialog(null, e);
}
}
每当我尝试调用 Update_Table 方法以更新时,JTable
就会发生这种情况