| | |
| | | import com.ltkj.LtkjApplication; |
| | | import com.ltkj.common.core.redis.RedisCache; |
| | | import com.ltkj.common.utils.SecurityUtils; |
| | | import com.ltkj.framework.config.MatchUtils; |
| | | import com.ltkj.hosp.domain.DictHosp; |
| | | import com.ltkj.hosp.domain.TjCustomer; |
| | | import com.ltkj.hosp.domain.TjPackage; |
| | |
| | | import java.io.InputStreamReader; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | import java.sql.Connection; |
| | | import java.sql.DriverManager; |
| | | import java.sql.SQLException; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | import java.io.InputStreamReader; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | import java.util.Properties; |
| | | |
| | | /** |
| | | * @Author: 西安路泰科技有限公司/赵佳豪 |
| | |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | |
| | | |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | // 初始数据库配置 |
| | | String initialUrl = "jdbc:mysql://initial_host:3306/initial_db"; |
| | | String username = "user"; |
| | | String password = "pass"; |
| | | |
| | | // 新数据库配置 |
| | | String newUrl = "jdbc:mysql://new_host:3306/new_db"; |
| | | |
| | | // 更改连接URL |
| | | String urlToUse = initialUrl; // 可以根据需要切换到newUrl |
| | | |
| | | // 创建数据库连接属性 |
| | | Properties props = new Properties(); |
| | | props.setProperty("user", username); |
| | | props.setProperty("password", password); |
| | | |
| | | try { |
| | | forwardUrl("192.168.0.5","www.baidu.com"); |
| | | } catch (Exception e) { |
| | | // 连接到数据库 |
| | | Connection conn = DriverManager.getConnection(urlToUse, props); |
| | | |
| | | // 使用conn进行数据库操作... |
| | | |
| | | // 关闭连接 |
| | | conn.close(); |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |