Skip to content

Commit

Permalink
Correcting the url by adding port
Browse files Browse the repository at this point in the history
  • Loading branch information
niteshnicholas committed Jun 12, 2019
1 parent aa8ae1f commit cf7f99f
Showing 1 changed file with 7 additions and 7 deletions.
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

0 comments on commit cf7f99f

Please sign in to comment.