SQL
This commit is contained in:
9
Jenkinsfile
vendored
9
Jenkinsfile
vendored
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user