这是Jenkins共享库中的新类.
共享库通过Manage Jenkins> Configure System下的标准方法加载
package com.mycorp.core;
@Grab(group='com.microsoft.sqlserver', module='mssql-jdbc', version='6.4.0.jre8')
import com.microsoft.sqlserver.jdbc.SQLServerDriver
import groovy.sql.Sql
class MySQLClass implements Serializable {
def dbconnection
def dbURL
def dbUsername
def dbPassword
def dbDriver
MySQLClass(databaseConfig) {
//Set any instance variables required.
this.dbURL = databaseConfig.sql.url
this.dbUsername = databaseConfig.sql.username
this.dbPassword = databaseConfig.sql.password
this.dbDriver = databaseConfig.sql.driver
}
def getConnection() {
return Sql.newInstance(dbURL,dbUsername,dbPassword,dbDriver)
}
}
Run Code Online (Sandbox Code Playgroud)
databaseConfig对象配置为:
def databaseConfig = [
url: 'jdbc:sqlserver://myhost:1433;databaseName=mydatabase',
user: 'user',
password: 'password',
driver: 'com.microsoft.sqlserver.jdbc.SQLServerDriver'
]
Run Code Online (Sandbox Code Playgroud)
当调用MyClass.getConnection()时,它失败并:
java.sql.SQLException: No suitable driver found for jdbc:sqlserver://myhost:1433;databaseName=mydatabase
at java.sql.DriverManager.getConnection(DriverManager.java:689) …Run Code Online (Sandbox Code Playgroud) 一个简单的问题,但谷歌搜索和搜索搜索没有任何进展.
有没有人知道是否有可能在Oracle数据字典中搜索所有包装(已使用'wrap'实用程序进行模糊处理)包/程序?
谢谢,约翰.
当然这有一个简单的答案,但无法理解它.
我有自举表,隐藏的行显示在它隐藏在后面的行的点击.但是,隐藏的行显示出来,当它们未被选中时,我无法让它们消失.
<table class='table table-hover table-bordered table-striped'>
<thead>
<tr>
<th>Status</th>
<th>Name</th>
<th>GuideWire</th>
</tr>
</thead>
<tbody>
<tr data-toggle='collapse' data-target='#info_1'>
<td>Good</td>
<td>FooBar</td>
<td>Something else</td>
</tr>
<tr>
<td colspan='8' class='hidden-row'>
<div class='collapse' id='info_1'>
<table class="table table-condensed table-sm small">
<thead>
<th>ABC</th>
<th>DEF</th>
</thead>
<tbody>
<tr>
<td>S1</td>
<td>Blah</td>
</tr>
<tr>
<td>S1</td>
<td>Blah</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
<tr data-toggle='collapse' data-target='#info_2'>
<td>Good 2</td>
<td>FooBar 2</td>
<td>Something else 2</td>
</tr>
<tr>
<td colspan='8' class='hidden-row'>
<div class='collapse' id='info_2'>
<table class="table table-condensed table-sm small">
<thead>
<th>ABC</th>
<th>DEF</th> …Run Code Online (Sandbox Code Playgroud) 我有一个关于一块批量收集sql的小问题,我希望你可以帮忙.
使用以下代码:
declare
cursor c1
is
select customer,product
from products;
type type_cust is table of products.customer%type;
type type_prod is table of products.product%type;
v_array_cust type_cust;
v_array_prod type_prod;
begin
open c1;
loop
fetch c1
into v_array_cust, v_array_prod
limit 1000;
exit when c1%notfound;
for i in 1..v_array_cust.count
loop
--Do some processing here.
end loop;
end loop;
end;
/
Run Code Online (Sandbox Code Playgroud)
光标c1返回53166行.
但是,代码处理53000行然后结束.似乎在去检索最后166条记录时会出现某种失败.
如果找到的记录少于1000条记录,那么fetch会返回%notfound吗?我应该将出口移动到循环的末尾吗?(我将尝试这个,但它深入一段代码需要3个小时才能达到失败点.)
提前致谢.