Skip to content

Commit

Permalink
Extracting version from database V17
Browse files Browse the repository at this point in the history
  • Loading branch information
SiddharthBITS committed Jan 22, 2025
1 parent 6330b25 commit a8ff17a
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions test/JDBC/src/test/java/com/sqlsamples/TestQueryFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public class TestQueryFile {

String inputFileName;
static Connection connection_bbl; // connection object for Babel instance
statuc Connection getVersionCon;

public static void createTestFilesListUtil(String directory, String testToRun) {
File dir = new File(directory);
Expand Down Expand Up @@ -274,10 +275,10 @@ public static void setup() throws IOException {
// Query against database to find test version
try
{
// connectionString = createSQLServerConnectionString(URL, tsql_port, databaseName, user, password);
// connection_bbl = DriverManager.getConnection(connectionString);
Statement stmt = connection_bbl.createStatement();
connectionString = createSQLServerConnectionString(URL, tsql_port, databaseName, user, password);
getVersionCon = DriverManager.getConnection(connectionString);

Statement stmt = getVersionCon.createStatement();
ResultSet rs = stmt.executeQuery("SELECT @@VERSION;");

int columnCount = rs.getMetaData().getColumnCount();
Expand Down Expand Up @@ -308,11 +309,11 @@ public static void setup() throws IOException {

System.out.println("VersionCheck : Version : " + majorVersion + "_" + minorVersion);

// if(connection_bbl != null)
// {
// connection_bbl.close();
// }
// connection_bbl = null;
if(getVersionCon != null)
{
getVersionCon.close();
}
getVersionCon = null;
}
catch (SQLException e)
{
Expand Down

0 comments on commit a8ff17a

Please sign in to comment.