简体   繁体   中英

What is the correct java.sql.Types for Oracle's NVARCHAR2

I have a column in my database that must store file names that can have non-latin characters. That's why it has NVARCHAR2 data type defined.

I would like to try something like this:

sqlParameterSource.registerSqlType("file_name", Types.NVARCHAR);

but I have serious doubt if I can use java.sql.Types.NVARCHAR for NVARCHAR2 type. Can I? If not, what should I use?

No is the simple answer:

The types NCHAR and NVARCHAR2 are supported indirectly. There is no corresponding java.sql.Types type (use CHAR), but if your application invokes formOfUse(NCHAR) then these types can be accessed. See "NCHAR, NVARCHAR2, NCLOB and the defaultNChar Property" for details.

See this link. for more info.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM