Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
32c3db0f
Commit
32c3db0f
authored
Feb 05, 2003
by
Dave Cramer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
patch from Oliver Jowett to implement some of the jdbc3 methods
parent
865429e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
1 deletion
+51
-1
src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java
...es/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java
+51
-1
No files found.
src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java
View file @
32c3db0f
...
@@ -14,7 +14,7 @@ import org.postgresql.largeobject.LargeObjectManager;
...
@@ -14,7 +14,7 @@ import org.postgresql.largeobject.LargeObjectManager;
import
org.postgresql.util.*
;
import
org.postgresql.util.*
;
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Connection.java,v 1.1
4 2003/02/04 09:20:08 barry
Exp $
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Connection.java,v 1.1
5 2003/02/05 11:12:39 davec
Exp $
* This class defines methods of the jdbc1 specification. This class is
* This class defines methods of the jdbc1 specification. This class is
* extended by org.postgresql.jdbc2.AbstractJdbc2Connection which adds the jdbc2
* extended by org.postgresql.jdbc2.AbstractJdbc2Connection which adds the jdbc2
* methods. The real Connection class (for jdbc1) is org.postgresql.jdbc1.Jdbc1Connection
* methods. The real Connection class (for jdbc1) is org.postgresql.jdbc1.Jdbc1Connection
...
@@ -1159,6 +1159,56 @@ public abstract class AbstractJdbc1Connection implements org.postgresql.PGConnec
...
@@ -1159,6 +1159,56 @@ public abstract class AbstractJdbc1Connection implements org.postgresql.PGConnec
return
dbVersionNumber
;
return
dbVersionNumber
;
}
}
// Parse a "dirty" integer surrounded by non-numeric characters
private
static
int
integerPart
(
String
dirtyString
)
{
int
start
,
end
;
for
(
start
=
0
;
start
<
dirtyString
.
length
()
&&
!
Character
.
isDigit
(
dirtyString
.
charAt
(
start
));
++
start
)
;
for
(
end
=
start
;
end
<
dirtyString
.
length
()
&&
Character
.
isDigit
(
dirtyString
.
charAt
(
end
));
++
end
)
;
if
(
start
==
end
)
return
0
;
return
Integer
.
parseInt
(
dirtyString
.
substring
(
start
,
end
));
}
/*
* Get server major version
*/
public
int
getServerMajorVersion
()
{
try
{
StringTokenizer
versionTokens
=
new
StringTokenizer
(
dbVersionNumber
,
"."
);
// aaXbb.ccYdd
return
integerPart
(
versionTokens
.
nextToken
());
// return X
}
catch
(
NoSuchElementException
e
)
{
return
0
;
}
}
/*
* Get server minor version
*/
public
int
getServerMinorVersion
()
{
try
{
StringTokenizer
versionTokens
=
new
StringTokenizer
(
dbVersionNumber
,
"."
);
// aaXbb.ccYdd
versionTokens
.
nextToken
();
// Skip aaXbb
return
integerPart
(
versionTokens
.
nextToken
());
// return Y
}
catch
(
NoSuchElementException
e
)
{
return
0
;
}
}
/**
/**
* Is the server we are connected to running at least this version?
* Is the server we are connected to running at least this version?
* This comparison method will fail whenever a major or minor version
* This comparison method will fail whenever a major or minor version
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment