91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 2.09MB
    文件類型: .gz
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2023-09-13
  • 語言: Java
  • 標簽: sqljdbc4.0??

資源簡介

java中使用的鏈接數(shù)據(jù)庫的jar包,從微軟官網(wǎng)中下載,有jdbc6.0文件與其他相關文件。

資源截圖

代碼片段和文件信息

/*=====================================================================
File:? ?executeStoredProcedure.java
Summary:?This?Microsoft?JDBC?Driver?for?SQL?Server?sample?application
?????????demonstrates?how?to?retrieve?a?large?OUT?parameter?from?
?????????a?stored?procedure?and?how?to?get?the?adaptive?buffering?mode.
---------------------------------------------------------------------
This?file?is?part?of?the?Microsoft?JDBC?Driver?for?SQL?Server?Code?Samples.
Copyright?(C)?Microsoft?Corporation.??All?rights?reserved.
?
This?source?code?is?intended?only?as?a?supplement?to?Microsoft
Development?Tools?and/or?on-line?documentation.??See?these?other
materials?for?detailed?information?regarding?Microsoft?code?samples.
?
THIS?CODE?AND?INFORMATION?ARE?PROVIDED?“AS?IS“?WITHOUT?WARRANTY?OF
ANY?KIND?EITHER?EXPRESSED?OR?IMPLIED?INCLUDING?BUT?NOT?LIMITED?TO
THE?IMPLIED?WARRANTIES?OF?MERCHANTABILITY?AND/OR?FITNESS?FOR?A
PARTICULAR?PURPOSE.
=====================================================================*/
import?java.sql.*;
import?java.io.*;
import?com.microsoft.sqlserver.jdbc.SQLServerCallableStatement;

public?class?executeStoredProcedure?{

????public?static?void?main(String[]?args)?{
????????//?Create?a?variable?for?the?connection?string.
????????String?connectionUrl?=?
???????????“jdbc:sqlserver://localhost:1433;“?+
???????????“databaseName=AdventureWorks;integratedSecurity=true;“;

????????//?Declare?the?JDBC?objects.
????????Connection?con?=?null;
????????Statement?stmt?=?null;
????????ResultSet?rs?=?null;??

????????try?{
??????????//?Establish?the?connection.
??????????Class.forName(“com.microsoft.sqlserver.jdbc.SQLServerDriver“);
??????????con?=?DriverManager.getConnection(connectionUrl);
?
??????????//?Create?test?data?as?an?example.
??????????StringBuffer?buffer?=?new?StringBuffer(4000);
??????????for?(int?i?=?0;?i??????????????buffer.append(?(char)?(‘A‘));

?????????????PreparedStatement?pstmt?=?con.prepareStatement(
??????????????????“UPDATE?Production.Document?“?+
???????????????????“SET?DocumentSummary?=???WHERE?(DocumentID?=?1)“);
?
?????????????pstmt.setString(1?buffer.toString());
?????????????pstmt.executeUpdate();
?????????????pstmt.close();

?????????????//?Query?test?data?by?using?a?stored?procedure.
?????????????CallableStatement?cstmt?=?
????????????????con.prepareCall(“{call?dbo.GetLargeDataValue(???????)}“);

?????????????cstmt.setInt(1?1);
?????????????cstmt.registerOutParameter(2?java.sql.Types.INTEGER);
?????????????cstmt.registerOutParameter(3?java.sql.Types.CHAR);
?????????????cstmt.registerOutParameter(4?java.sql.Types.LONGVARCHAR);

?????????????//?Display?the?response?buffering?mode.
?????????????SQLServerCallableStatement?SQLcstmt?=?(SQLServerCallableStatement)?cstmt;
?????????????System.out.println(“Response?buffering?mode?is:?“?+
???????????????????SQLcstmt.getResponseBuffering());

?????????????SQLcstmt.execute();
?????????????S

評論

共有 條評論

相關資源