Created
November 2, 2020 19:38
-
-
Save nuxlli/8797068d74afe99e84effd1ecce00e55 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.sql.SQLException; | |
import java.sql.DriverManager; | |
import java.sql.Connection; | |
public class TestConnect { | |
public static void main(String[] args) throws ClassNotFoundException, SQLException { | |
System.out.println("Connection test..."); | |
//you need create database with this name 'github-example-jdbc' | |
String url = System.getenv("RUNDECK_DATABASE_URL"); | |
String user = System.getenv("RUNDECK_DATABASE_USERNAME"); | |
String password = System.getenv("BRUNDECK_DATABASE_PASSWORD"); | |
Class.forName(System.getenv("RUNDECK_DATABASE_DRIVER")); | |
Connection connection = DriverManager.getConnection(url, user, password); | |
System.out.println("Connected..."); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment