The jdbc encoding is set when java connects to the database.
I found that there are a lot of pitfalls on the Internet, and many meanings are incomplete. For example, when jdbc is connected to the mysql database, set the character set encoding.
You can configure mysql as follows. You can add character set settings directly after the url:
... Omitted
String url = "jdbc: mysql: // localhost: 3306/exceltest1? UseUnicode = true & characterEncoding = UTF-8 & zeroDateTimeBehavior = convertToNull ";
String username = "root ";
String password = "123456 ";
... Omitted
But oracle cannot connect, and he will prompt that SID cannot be found.
The error example is as follows:
Url = jdbc: oracle: thin: @ 192.168.1.233: 1521: oradbcharacterEncoding = UTF-8
In fact, the oracle Character Set defaults to the database character set. The method for viewing the database character set is as follows:
Select userenv ('language') from dual;
The following describes how to modify the character set of an oracle database (searched online ):
How to modify the character set of an oracle Database
I chose to back up the database, delete the original database, create a database, set the character set, and then import it to the backup ~