From 2c4d842ee5fae29886ce208900eaaf4619e315c9 Mon Sep 17 00:00:00 2001 From: lizhenzhen Date: Fri, 17 Nov 2023 17:57:14 +0800 Subject: [PATCH] 11 --- .../service/impl/InformixJdbcProxyServiceImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/beagle/informix/service/impl/InformixJdbcProxyServiceImpl.java b/src/main/java/com/beagle/informix/service/impl/InformixJdbcProxyServiceImpl.java index 127cf77..64e4221 100644 --- a/src/main/java/com/beagle/informix/service/impl/InformixJdbcProxyServiceImpl.java +++ b/src/main/java/com/beagle/informix/service/impl/InformixJdbcProxyServiceImpl.java @@ -68,7 +68,7 @@ public class InformixJdbcProxyServiceImpl implements InformixService { // Unknown exception: Can not find JDBC type `2005` in column type Driver driver = getDriver(); Connection conn = getConnection(driver); - conn.prepareStatement("SET character_set_results = NULL ").execute(); + conn.prepareStatement("select * from \"test_tab_new24\" ").execute(); closeConnection(conn); deregisterDriver(driver); } @@ -106,7 +106,8 @@ public class InformixJdbcProxyServiceImpl implements InformixService { private Driver getDriver() throws Exception{ // 定义informix的驱动信息 - String driverUrl = "com.mysql.jdbc.Driver"; +// String driverUrl = "com.mysql.jdbc.Driver"; + String driverUrl = "org.postgresql.Driver"; // 还需要加入informix的jdbc驱动jar包 Class driverClass = Class.forName(driverUrl); return (Driver) driverClass.getConstructor().newInstance(); @@ -128,7 +129,7 @@ public class InformixJdbcProxyServiceImpl implements InformixService { Properties properties = new Properties(); // 组装连接数据库信息 BITBUCKET_NEW // jdbc:informix-sqli://:/:informixserver= - StringBuilder jdbcBuilder = new StringBuilder("jdbc:mysql://localhost:3307/SYSDBA?character_set_results=utf8");// # ?useServerPrepStmts=true + StringBuilder jdbcBuilder = new StringBuilder("jdbc:postgresql://localhost:3307/testdb?character_set_results=utf8");// # ?useServerPrepStmts=true DriverManager.setLoginTimeout(10); properties.put("user", "root"); properties.put("password", "Apurelove9014"); -- 2.26.0