🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.java.help
Article #140

Re: JDBC:ODBC - Feature not implemented?

#140
From: Jeff Robertson
Date: Thu, 19 Jul 2001 21:10
31 lines
2412 bytes
"Alexey Kuznetsov" <getweb@pochta.org> wrote in message news:<9j35gr$8rj$1@news.sovam.com>...
> Hello, All !
> 
> Suggest please why the following code throws an exception:
>  ...
>   Connection con = DriverManager.getConnection("jdbc:odbc:DB;uid=sa;");
>   PreparedStatement ps = con.prepareStatement("INSERT INTO log VALUES (?,
> 1)");
>   ps.setDate(1, new java.sql.Date(System.currentTimeMillis()));
>   ps.executeUpdate();
> ....
> 
> Exception in thread "main" java.sql.SQLException: [Microsoft][ODBC SQL
> Server Dr
> iver]Optional feature not implemented
>         at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6031)
>         at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6188)
>         at sun.jdbc.odbc.JdbcOdbc.SQLBindInParameterDate(JdbcOdbc.java:752)
>         at
> sun.jdbc.odbc.JdbcOdbcPreparedStatement.setDate(JdbcOdbcPreparedState
> ment.java:833)
> 
> Here is the table definition SQL statement:
> create table log (
>    execdate datetime not null,
>    toolid int not null
> )

What happens if you use java.sql.Timestamp instead of java.sql.Date? I
would suspect that Timestamp maps to "datetime" better than Date. Just
a guess... I've never used the JDBC/ODBC bridge.
Technical Details
Message-ID: <77bae85f.0107191310.10f5fbeb@posting.google.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!postnews1.google.com!not-for-mail
References: <9j35gr$8rj$1@news.sovam.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 107d46,cc7d5a6bac724d41
X-Google-Attributes: gid107d46,public
X-Google-Thread: 10a146,cc7d5a6bac724d41
X-Google-Attributes: gid10a146,public
X-Google-Thread: fb99b,cc7d5a6bac724d41
X-Google-Attributes: gidfb99b,public
X-Google-Thread: 113ae9,cc7d5a6bac724d41
X-Google-Attributes: gid113ae9,public
X-Google-ArrivalTime: 2001-07-19 14:10:10 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!postnews1.google.com!not-for-mail
From: jeff_robertson@yahoo.com (Jeff Robertson)
Newsgroups: comp.lang.java.help,comp.lang.java.databases,comp.lang.java.programmer,cz.comp.lang.java
Subject: Re: JDBC:ODBC - Feature not implemented?
Date: 19 Jul 2001 14:10:10 -0700
Organization: http://groups.google.com/
Lines: 31
Message-ID: <77bae85f.0107191310.10f5fbeb@posting.google.com>
References: <9j35gr$8rj$1@news.sovam.com>
NNTP-Posting-Host: 209.246.161.130
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 995577010 8229 127.0.0.1 (19 Jul 2001 21:10:10 GMT)
X-Complaints-To: groups-support@google.com
NNTP-Posting-Date: 19 Jul 2001 21:10:10 GMT