From dbdc838492ea812cc70a4ab8f7a49d55a937753d Mon Sep 17 00:00:00 2001
From: Pavel Kachalouski
Date: Sun, 22 Jan 2023 13:42:18 +0100
Subject: [PATCH] SQL
---
Jenkinsfile | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 839d2fe..1f5f36c 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -5,10 +5,13 @@ pipeline {
}
stages {
stage('Build') {
- steps {
- sql 'select * from test;'
+ steps {
+ import groovy.sql.Sql
+ Class.forName("com.mysql.jdbc.Driver")
+ def sql = Sql.newInstance("jdbc:mysql://mysql:3306/test_db", "user","passwd", "com.mysql.jdbc.Driver")
+ def rows = sql.execute "select count(*) from test_table;"
+ echo rows.dump()
}
}
}
}
-