Released version 4.2. 4.2
authorMarco Zanon <info@marcozanon.com>
Mon, 5 Dec 2016 14:27:54 +0000 (14:27 +0000)
committerMarco Zanon <info@marcozanon.com>
Mon, 5 Dec 2016 14:27:54 +0000 (14:27 +0000)
src/java/com/marcozanon/macaco/MInformation.java
src/java/com/marcozanon/macaco/database/MDatabaseConnection.java

index f0d290bb493532683f710527b2077925423a697f..39295b882d078ce26057a9c96ed993cf3d94296a 100644 (file)
@@ -12,7 +12,7 @@ import java.io.StringWriter;
 
 public class MInformation extends MObject {
 
-    public static final String MACACO_VERSION = "4.x";
+    public static final String MACACO_VERSION = "4.2";
 
     public static final String TEXT_ENCODING = "UTF-8";
 
index e45cd2120ec5f1ea35a09680e4ae4c1d51f95049..2ce3220714b4b583d28db48741b4d577c617481f 100644 (file)
@@ -13,6 +13,7 @@ import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.PreparedStatement;
 import java.sql.SQLException;
+import java.util.LinkedHashMap;
 import java.util.LinkedList;
 
 public class MDatabaseConnection extends MObject {
@@ -268,4 +269,13 @@ public class MDatabaseConnection extends MObject {
         }
     }
 
+    /* Engine version. */
+
+    public String getEngineVersion() throws MSqlStatementException {
+        MSqlStatementResults results = this.executePreparedStatement("SELECT VERSION()");
+        LinkedList<LinkedHashMap<String, Object>> resultList = results.getRecords();
+        //
+        return (String)resultList.get(0).get("VERSION()");
+    }
+
 }