Skip to content

Commit

Permalink
Extracting version from database V7
Browse files Browse the repository at this point in the history
  • Loading branch information
SiddharthBITS committed Jan 22, 2025
1 parent 2ace22e commit f53553f
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions test/JDBC/src/test/java/com/sqlsamples/TestQueryFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -496,16 +496,9 @@ public void TestQueryBatch(String inputFileName) throws SQLException, ClassNotFo
Pattern pattern = Pattern.compile("PostgreSQL (\\d+\\.\\d+)");
Matcher matcher = pattern.matcher(queryOutput);

if (matcher.find())
{
majorVersion = Integer.parseInt(matcher.group(1));
minorVersion = Integer.parseInt(matcher.group(2));
} else
{
majorVersion = 0;
minorVersion = 0;
}

String versionString = Integer.parseInt(matcher.group(1));
majorVersion = Integer.parseInt(versionString.split("\\.")[0]);
minorVersion = Integer.parseInt(versionString.split("\\.")[1]);
}
catch (SQLException e)
{
Expand Down

0 comments on commit f53553f

Please sign in to comment.