Calendar fDATETIME = Calendar.getInstance(); // creates calendar
Calendar tDATETIME = Calendar.getInstance();
SimpleDateFormat ShortDateFormat = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
SimpleDateFormat DateFormatForSQLOracle = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
fDATETIME.setTime(ShortDateFormat.parse(DATETIME_FROM));
tDATETIME.setTime(ShortDateFormat.parse(DATETIME_TO));
try (Connection conn = DriverManager.getConnection(DB_URL_Connection, DB_UserName, DB_Password)) {
PreparedStatement prepStmt = conn.prepareStatement(sql);
prepStmt.setTimestamp(1, java.sql.Timestamp.valueOf(DateFormatForSQLOracle.format(fDATETIME.getTime())));
prepStmt.setTimestamp(2, java.sql.Timestamp.valueOf(DateFormatForSQLOracle.format(tDATETIME.getTime())));
prepStmt.setString(3, "%Хост: %");
ResultSet result = prepStmt.executeQuery();
c:\Server\Apache\bin>chcp
Текущая кодовая страница: 866
c:\Server\Apache\bin>chcp 1251
Текущая кодовая страница: 1251
SQL> select * from customers;
ID NAME
============ ==================================================
1 first
2 ўв®а®©
4 зҐвўҐавл©
5 пятый
AuthServer = Srp, Legacy_Auth
UserManager = Srp, Legacy_Auth
WireCrypt = Enabled
CREATE USER SYS PASSWORD 'пароль' USING PLUGIN Legacy_UserManager;
GRANT SELECT, UPDATE, INSERT, DELETE ON customers TO SYS;