From: | gm at winls(dot)com (George McQuade) |
---|---|
To: | |
Subject: | [Pljava-dev] date handling... |
Date: | 2005-08-14 04:45:17 |
Message-ID: | 1123994718.4039.9.camel@sat1 |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pljava-dev |
Hello list,
We have successfully installed pljava on a postgres 7.4.1 system running
under Fedora Core 1. Everything seems to work fine except for a date
handling issue.
The listed function attempts to retrieve a date from the db.
The birthdate column is of pg type "Date".
The logger will output "Birthdate 2005-07-31"
The birthdate stored for custid=385 is 2005-08-01.
Seems the builtin pljava jdbc driver is performing some sort of timezone
adjustment. Has anyone run into this before?
Thanks
george
package winls.dbdata.pljava;
import java.sql.*;
import java.util.logging.*;
import org.postgresql.pljava.*;
import java.util.Date;
/**
*
* @author user
*/
public class DateFunc {
public static void getBirthDate(){
try {
Statement m_statement =
DriverManager.getConnection("jdbc:default:connection").createStatement();
String query="select birthdate from customers where custid
=385 ";
ResultSet rs=m_statement.executeQuery(query);
if(rs != null)
while(rs.next()){
Logger.getAnonymousLogger().info("Birthdate
"+rs.getDate(1));
}
}
catch (Exception e){
Logger.getAnonymousLogger().info(""+e.getMessage());
}
}
}
From | Date | Subject | |
---|---|---|---|
Next Message | Thomas Hallgren | 2005-08-14 08:13:07 | [Pljava-dev] date handling... |
Previous Message | Thomas Hallgren | 2005-08-11 19:43:20 | [Pljava-dev] Error Loading libpljava.so |