Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am using UCanAccess JDBC-driver (version 3.0.3.1) to connect to the mdb-file. And I need to add the column to existing table. The problem is that the statement

ALTER TABLE TEmployee ADD COLUMN NotificationsEnabled BINARY

throws the exception:

net.ucanaccess.jdbc.UcanaccessSQLException: UCAExc:::3.x.x Feature not supported yet.

And it seems like there is no newer versions of UCanAccess.

What can I do in such a situation? I don`t want to use the ODBC driver for many reasons (described here - Manipulating an Access database from Java without ODBC)

The only solution that I see is to create the copy of the table (e.g. TEmployeeBackup) to save the data, then drop and recreate the original table with new field, and then move the data back from TEmployeeBackup to TEmployee. But this solution seems awful to me.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
634 views
Welcome To Ask or Share your Answers For Others

1 Answer

Ucanaccess can't support this very requested feature until the underlying jackcess library doesn't support it. We (Ucanaccess team) could automate the above mentioned steps, but for the same reason, we can't create fk and so, in many cases, reproduce an exact copy of an original table. While altering a table, we would lose the referential integrity constraints... so, for now, it's better to do nothing. So sorry, no solution currently.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...