简体   繁体   中英

Why IntelliJ IDEA doesn't connect oracle database with java code in maven project?

I'm trying to make maven project which should work with oracle database.

First I tried to connect database to DB Browser in IDEA, but I've no idea how to use it in code if it's even possible. However I use following java code:

Base.open("oracle.jdbc.driver.OracleDriver", "jdbc:oracle:thin:@localhost:1521:XE", "SYSTEM", "pass");

it doesn't run with error Failed to connect to JDBC URL:

jdbc:oracle:thin:@localhost:1521:XE Caused by: java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1
ORA-12705: Cannot access NLS data files or invalid environment specified.

But according to connection info in DB browser it's written right. What's going wrong?

Problem solved by following code before Base.open(...); : Locale.setDefault(Locale.ENGLISH);

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