-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Discussing] Can I add SSH connections to JDBC data sources? #3520
Labels
Comments
请详细描述一下 |
非必须功能,目前社区暂无此计划,如你对此功能有兴趣可以实现,欢迎贡献社区 |
你可以使用 jsch 库完成以上需求 <!-- https://mvnrepository.com/artifact/com.github.mwiede/jsch -->
<dependency>
<groupId>com.github.mwiede</groupId>
<artifactId>jsch</artifactId>
<version>${jssh.version}</version>
</dependency>
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class JdbcSSHConnectConfig {
@ApiModelProperty(
value = "SSH host",
dataType = "String",
example = "192.168.127.12",
notes = "SSH host")
private String sshHost;
@ApiModelProperty(
value = "SSH port",
dataType = "Integer",
example = "22",
notes = "SSH port")
private int sshPort;
@ApiModelProperty(
value = "SSH username",
dataType = "String",
example = "root",
notes = "SSH username")
private String sshUsername;
@ApiModelProperty(
value = "SSH password",
dataType = "String",
example = "root",
notes = "SSH password")
private String sshPassword;
@ApiModelProperty(
value = "Local forward port",
dataType = "Integer",
example = "3306",
notes = "Local forward port")
private int localForwardPort;
}
@ApiModelProperty(
value = "Whether to use ssh tunnel", example = "true", notes = "Whether to use ssh tunnel")
private boolean useSshTunnel = false;
@ApiModelProperty(
value = "Whether to use ssh tunnel", example = "true", notes = "Whether to use ssh tunnel")
private JdbcSSHConnectConfig sshConnectConfig; 其他代码自行根据逻辑实现 |
Hello @, this issue has not been active for more than 30 days. This issue will be closed in 7 days if there is no response. If you have any questions, you can comment and reply. 你好 @, 这个 issue 30 天内没有活跃,7 天后将关闭,如需回复,可以评论回复。 |
好的,谢谢 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Search before asking
Description
jdbc数据源是否可以增加ssh的连接方式
Use case
No response
Related issues
No response
Are you willing to submit a PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: