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

Correcting the url by adding port #564

Merged
merged 1 commit into from
Jun 17, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions optimus/io/jdbc.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@ def __init__(self, db_type, url, database, user, password, port=None):
# RaiseIt.value_error(db_type, ["redshift", "postgres", "mysql", "sqlite"])
self.db_type = db_type

# Create string connection
if self.db_type is "sqlite":
url = "jdbc:" + db_type + ":" + url + "/" + database
else:
url = "jdbc:" + db_type + "://" + url + "/" + database

# Handle the default port
# Handle the default port
if port is None:
if self.db_type is "redshift":
self.port = 5439
Expand All @@ -38,6 +32,12 @@ def __init__(self, db_type, url, database, user, password, port=None):
elif self.db_type is "mysql":
self.port = 3306

# Create string connection
if self.db_type is "sqlite":
url = "jdbc:" + db_type + ":" + url + "/" + database
else:
url = "jdbc:" + db_type + "://" + url + ":" + port + "/" + database

self.url = url
self.database = database
self.user = user
Expand Down