• 大小: 8.48MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-10-06
  • 语言: Java
  • 标签: JAVA  

资源简介

本排课系统是自己完成的一个课程设计,用JAVA实现,数据库用的SQLserver,对于需要做课程设计的同学有一定参考价值。

资源截图

代码片段和文件信息

/*=====================================================================
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 < 4000; 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

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        398  2014-12-01 19:02  排课系统代码--机密\DatabaseDesign\.classpath

     文件        390  2014-11-17 15:49  排课系统代码--机密\DatabaseDesign\.project

     文件         78  2014-11-17 15:53  排课系统代码--机密\DatabaseDesign\.settings\org.eclipse.core.resources.prefs

     文件        598  2014-09-27 09:54  排课系统代码--机密\DatabaseDesign\.settings\org.eclipse.jdt.core.prefs

     文件       1542  2015-01-09 09:47  排课系统代码--机密\DatabaseDesign\bin\team\sqlDesign\About.class

     文件       1079  2015-01-09 09:47  排课系统代码--机密\DatabaseDesign\bin\team\sqlDesign\AdminLogin$1.class

     文件       1674  2015-01-09 09:47  排课系统代码--机密\DatabaseDesign\bin\team\sqlDesign\AdminLogin$2.class

     文件        735  2015-01-09 09:47  排课系统代码--机密\DatabaseDesign\bin\team\sqlDesign\AdminLogin$3.class

     文件       2280  2015-01-09 09:47  排课系统代码--机密\DatabaseDesign\bin\team\sqlDesign\AdminLogin.class

     文件       1200  2015-01-09 09:47  排课系统代码--机密\DatabaseDesign\bin\team\sqlDesign\Classes$1.class

     文件       5059  2015-01-09 09:47  排课系统代码--机密\DatabaseDesign\bin\team\sqlDesign\Classes$MyActionListener.class

     文件       4847  2015-01-09 09:47  排课系统代码--机密\DatabaseDesign\bin\team\sqlDesign\Classes.class

     文件       1293  2015-01-09 09:47  排课系统代码--机密\DatabaseDesign\bin\team\sqlDesign\ClassroomManage$1.class

     文件        839  2015-01-09 09:47  排课系统代码--机密\DatabaseDesign\bin\team\sqlDesign\ClassroomManage$ClassroomTableModel.class

     文件       4646  2015-01-09 09:47  排课系统代码--机密\DatabaseDesign\bin\team\sqlDesign\ClassroomManage$MyActionListener.class

     文件       5215  2015-01-09 09:47  排课系统代码--机密\DatabaseDesign\bin\team\sqlDesign\ClassroomManage.class

     文件       3230  2015-01-09 09:47  排课系统代码--机密\DatabaseDesign\bin\team\sqlDesign\CommonTableModel.class

     文件       1317  2015-01-09 09:47  排课系统代码--机密\DatabaseDesign\bin\team\sqlDesign\CourseAssignManage$1.class

     文件        871  2015-01-09 09:47  排课系统代码--机密\DatabaseDesign\bin\team\sqlDesign\CourseAssignManage$CourseAssignTableModel.class

     文件       4709  2015-01-09 09:47  排课系统代码--机密\DatabaseDesign\bin\team\sqlDesign\CourseAssignManage$MyActionListener.class

     文件       5361  2015-01-09 09:47  排课系统代码--机密\DatabaseDesign\bin\team\sqlDesign\CourseAssignManage.class

     文件       1269  2015-01-09 09:47  排课系统代码--机密\DatabaseDesign\bin\team\sqlDesign\CourseManage$1.class

     文件        809  2015-01-09 09:47  排课系统代码--机密\DatabaseDesign\bin\team\sqlDesign\CourseManage$CourseTableModel.class

     文件       4550  2015-01-09 09:47  排课系统代码--机密\DatabaseDesign\bin\team\sqlDesign\CourseManage$MyActionListener.class

     文件       5146  2015-01-09 09:47  排课系统代码--机密\DatabaseDesign\bin\team\sqlDesign\CourseManage.class

     文件       4893  2015-01-09 09:47  排课系统代码--机密\DatabaseDesign\bin\team\sqlDesign\CourseTable.class

     文件        764  2015-01-09 09:47  排课系统代码--机密\DatabaseDesign\bin\team\sqlDesign\LoginDialog$1.class

     文件       2168  2015-01-09 09:47  排课系统代码--机密\DatabaseDesign\bin\team\sqlDesign\LoginDialog$MyActionListener.class

     文件       6264  2015-01-09 09:47  排课系统代码--机密\DatabaseDesign\bin\team\sqlDesign\LoginDialog.class

     文件       5286  2015-01-09 09:47  排课系统代码--机密\DatabaseDesign\bin\team\sqlDesign\Mainframe.class

............此处省略2739个文件信息

评论

共有 条评论