RECONFIGURE
EXEC SP_CONFIGURE 'Ad Hoc Distributed Queries',1
RECONFIGURE
插入的代码:
INSERT INTO dbo.Resources(ResourcesUrl,ResourcesLink,ResourcesText) SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0HDR=YESDatabase=F:\Book1.xls', [sheet1$])
java调用bat文件的实例:import java.io.*
public class Test{
public static void main(String[] args){
try {
//执行批处理文件
Process process = Runtime.getRuntime().exec("D:\\retrace.bat")
//取得命令结果的输出流
InputStream fis = process.getInputStream()
//用一个读输出流类去读
BufferedReader br = new BufferedReader(new InputStreamReader(fis))
String line = null
//逐行读取输出到控制台
while ((line = br.readLine()) != null) {
System.out.println(line)
}
} catch (IOException e) {
e.printStackTrace()
}
}
}
如果对你有帮助,请及时采纳。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)