I am using postgresql database. I am inserting values ββinto a database from a java class. I declared a field that has a data type without a time zone as a string. I do not know how to parse and send it to a database that matches the data type? How to do it?
public static void User(Form t)
{
String insertTableSQL = "INSERT INTO DBUSER"
+ "(USER_ID, USERNAME,CREATED_DATE) VALUES"
+ "(?,?,?)";
PreparedStatement ps = dbConnection.prepareStatement(insertTableSQL);
ps.setString(1, t.getUserID());
ps.setString(2, t.getuserName());
ps.setString(3, t.getTime());
ps.executeUpdate();
}
Error: Error: CREATED_DATE has a time without a time zone, but the expression has a character that changes Hint: try making an expression
source
share