Skip to content
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

Newbie question database connection question #21

Closed
scull7 opened this issue Nov 24, 2019 · 1 comment
Closed

Newbie question database connection question #21

scull7 opened this issue Nov 24, 2019 · 1 comment

Comments

@scull7
Copy link
Contributor

scull7 commented Nov 24, 2019

How would I translate the following connection string?

jdbc:oracle:thin:@//127.0.0.1:1522/some.oracle.service-name.org
@scull7
Copy link
Contributor Author

scull7 commented Nov 24, 2019

For other's looking for a similar thing:

fn connect() -> Result<oracle::Connection, oracle::Error> {
    let host = "127.0.0.1";
    let port = 1522;  // custom port value (default is 1521)
    let service_name = "some.oracle.service-name.org";

    let connect_string = format!("//{}:{}/{}", host, port, service_name);

    println!("CONNECTION STRING = {}", &connect_string);
    let user = "username";
    let password = "password";

    oracle::Connection::connect(user, password, connect_string)
}

@scull7 scull7 closed this as completed Nov 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant