Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
qir
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julien Lopez
qir
Commits
e790dc31
Commit
e790dc31
authored
Oct 16, 2015
by
Julien Lopez
Browse files
Options
Downloads
Patches
Plain Diff
Modify driver connection api
parent
074d4902
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/qir/driver/DBDriver.java
+18
-1
18 additions, 1 deletion
src/qir/driver/DBDriver.java
src/qir/driver/OracleDriver.java
+1
-2
1 addition, 2 deletions
src/qir/driver/OracleDriver.java
src/qir/driver/PostgreSQLDriver.java
+2
-3
2 additions, 3 deletions
src/qir/driver/PostgreSQLDriver.java
with
21 additions
and
6 deletions
src/qir/driver/DBDriver.java
+
18
−
1
View file @
e790dc31
...
...
@@ -8,8 +8,17 @@ import qir.ast.data.*;
public
abstract
class
DBDriver
{
protected
Connection
conn
;
protected
ConnectionData
connData
;
public
abstract
void
openConnection
(
ConnectionData
connData
)
throws
SQLException
;
public
void
openConnection
()
throws
SQLException
{
openConnection
(
connData
);
}
public
void
openConnection
(
ConnectionData
data
)
throws
SQLException
{
if
(
conn
!=
null
)
closeConnection
();
connData
=
data
;
}
public
void
closeConnection
()
throws
SQLException
{
if
(
conn
==
null
)
...
...
@@ -18,5 +27,13 @@ public abstract class DBDriver {
conn
=
null
;
}
public
boolean
isConnOpen
()
{
return
conn
!=
null
;
}
public
void
setConnectionData
(
ConnectionData
connData
)
{
this
.
connData
=
connData
;
}
public
abstract
QIRList
run
(
QIRNode
root
);
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/qir/driver/OracleDriver.java
+
1
−
2
View file @
e790dc31
...
...
@@ -18,8 +18,7 @@ import qir.driver.ConnectionData;
public
class
OracleDriver
extends
DBDriver
{
@Override
public
void
openConnection
(
ConnectionData
data
)
throws
SQLException
{
if
(
conn
!=
null
)
closeConnection
();
super
.
openConnection
(
data
);
String
connString
=
"jdbc:oracle:thin:@"
+
data
.
serverName
+
":"
+
data
.
portNumber
+
":"
+
data
.
sid
;
OracleDataSource
ods
=
new
OracleDataSource
();
ods
.
setUser
(
data
.
userName
);
...
...
This diff is collapsed.
Click to expand it.
src/qir/driver/PostgreSQLDriver.java
+
2
−
3
View file @
e790dc31
...
...
@@ -17,9 +17,8 @@ import qir.util.QIRPrintVisitor;
*/
public
class
PostgreSQLDriver
extends
DBDriver
{
@Override
public
void
openConnection
(
ConnectionData
connData
)
throws
SQLException
{
if
(
conn
!=
null
)
closeConnection
();
public
void
openConnection
(
ConnectionData
data
)
throws
SQLException
{
super
.
openConnection
(
data
);
String
url
=
"jdbc:postgresql://"
+
connData
.
serverName
+
":"
+
connData
.
portNumber
+
"/"
+
connData
.
sid
;
Properties
props
=
new
Properties
();
props
.
setProperty
(
"user"
,
connData
.
userName
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment