Java数据库连接(Java Database Connectivity,简称JDBC),是Java语言中用来规范客户端程序如何来访问数据库的应用程序接口,提供了诸如查询和更新数据库中数据的方法。
您好, 现在CKafka支持 kafka-connect-kafka(内侧功能),暂时还不能支持 jdbc的connector。如果这是您的需求,请提交工单,联系腾讯云工程师描述您的需求,我们会尽快规划并实现。
public static Connection getConnection() {
Connection conn = null;
try {
Class.forName(PropertiesHelp.getProperties("driver_manager"));
String url = PropertiesHelp.getProperties("jdbc_url");
String username = PropertiesHelp.getProperties("jdbc_name");
String password = PropertiesHelp.getProperties("jdbc_pwd");
System.out.println(PropertiesHelp.getProperties("driver_manager")+"---"+url+"-----"+username+"----"+password);
conn = DriverManager.getConnection(url, username, password);
} catch (ClassNotFoundException e) {
throw new RuntimeException("未找到驱动类", e);
} catch (SQLException e) {
throw new RuntimeException("数据库连接有问题", e);
}
return conn;
}