- 讲师:刘萍萍 / 谢楠
- 课时:160h
- 价格 4580 元
特色双名师解密新课程高频考点,送国家电网教材讲义,助力一次通关
配套通关班送国网在线题库一套
百度广告
创建表:
CREATE TABLE [BookUser] ( [UserName] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL , [Guid] [uniqueidentifier] NOT NULL CONSTRAINT [DF_BookUser_Guid] DEFAULT (newid()), [Description] [ntext] COLLATE Chinese_PRC_CI_AS NOT NULL , [Other] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL CONSTRAINT CONSTRAINT [PK_BookUser] PRIMARY KEY CLUSTERED [UserID] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] |
CREATE PROCEDURE InsertUser @Title varchar(255), @BirthDate DateTime, @Photo image, @UserID int output Set NOCOUNT ON RETURN 0 Begin SET @UserID = @@IDENTITY End |
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <head> <body> //注意:下面的连接方法采用最新的SQL Server的JDBC, Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); String sql = "{? = call InsertUser(?,?,?,?,?,?,?,?)}"; CallableStatement cmd = null; { cmd = cn.prepareCall(sql); String FilePath = application.getRealPath("") + ""test"logo.gif"; Date rightNow = Date.valueOf("2007-9-9"); cmd.setString("Title","孟宪会"); cmd.setString("BirthDate","2007-9-9"); cmd.setString("Description","【孟子E章】"); cmd.setString("Other",null); cmd.registerOutParameter("UserID",java.sql.Types.INTEGER); int returnValue = cmd.getInt(1); if(returnValue == 1) out.print("<li>添加成功!"); out.print("<li>returnValue = " + returnValue); else out.print("<li>添加失败!"); f.close(); catch(Exception ex) out.print(ex.getLocalizedMessage()); finally try if(cmd != null) cmd.close(); } { cn = null; } { } %> </html> |
责编:罗莉
课程专业名称 |
讲师 |
课时 |
查看课程 |
---|
课程专业名称 |
讲师 |
课时 |
查看课程 |
---|
点击加载更多评论>>