Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / July 2003

Tip: Looking for answers? Try searching our database.

Access JDBC LONGVARCHAR

Thread view: 
Ian deSouza - 01 Jul 2003 23:16 GMT
I'm getting the following error:

create table Categories (CategoryID INTEGER, CategoryName VARCHAR,
Description LONGVARCHAR, Picture LONGVARBINARY)

java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]
Syntax error in field definition.
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6879)
    at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7036)
    at sun.jdbc.odbc.JdbcOdbc.SQLPrepare(JdbcOdbc.java:4784)
    at sun.jdbc.odbc.JdbcOdbcConnection.prepareStatement(JdbcOdbcConnection.java:475)
    at sun.jdbc.odbc.JdbcOdbcConnection.prepareStatement(JdbcOdbcConnection.java:443)

Any ideas? I imagine that Access does like LONGVARBINARY, even though
the driver tells me that this column is that SQL type when viewing the
database.metadata getColumns()..

Thanks in advance, Ian
Andy Flowers - 02 Jul 2003 08:06 GMT
Your SQL syntax is wrong for MS Access. The LONGVARCHAR is not recognised by
Access, and neither is LONGVARBINARY.

Remember all that, basically, JDBC does with SQL statements is pass them
straight through to the database engine where it is validated and
interpreted.

I'd suggest that you MEMO instead of LONGVARCHAR and IMAGE instead of
LONGVARBINARY.

Test the query out in Access to ensure that it works OK before porting it to
the Java/JDBC-ODBC environment.

> I'm getting the following error:
>
[quoted text clipped - 7 lines]
> at sun.jdbc.odbc.JdbcOdbc.SQLPrepare(JdbcOdbc.java:4784)
> at
sun.jdbc.odbc.JdbcOdbcConnection.prepareStatement(JdbcOdbcConnection.java:47
5)
> at
sun.jdbc.odbc.JdbcOdbcConnection.prepareStatement(JdbcOdbcConnection.java:44
3)

> Any ideas? I imagine that Access does like LONGVARBINARY, even though
> the driver tells me that this column is that SQL type when viewing the
> database.metadata getColumns()..
>
> Thanks in advance, Ian


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.