Cormac De Barra

Greenhorn
+ Follow
since Mar 13, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Cormac De Barra

I'm have a database with two fields Date(Date/Time) and amount(text) and I want to retrieve the Date With the following code.


Connection connectionObject;
connectionObject = DriverManager.getConnection(URL,username,password);
StatementObject = connectionObject.createStatement();

String sqlQuery = "SELECT [Date] FROM Account;";

ResultSet statementResult = statementObject.executeQuery(sqlQuery);
while(statementResult.next())
{
DateFormat df = DateFormat.getDateInstance();
java.sql.Date d = statementResult.getDate(1);
String formattedDate = df.format(d);
}

but I get this error:

Problem with nullsent to jdbc dbc:shop.
Problem is : [Microsoft][ODBC Microsoft Access Driver]Invalid character value for cast specification on column number 1 (Date)

Can anyone tell me what the problem is and how to fix it.

Thx