C#中用于连接SQL数据库的SQLHelper类
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient; //引用命名空间
namespace DAL
{
/*******************************************************************************
* Name: SQLHelper
* File: SQLHelper.cs
* Description: 用于完成对数据库的相关操作
* Author: 雪狼
* DateTime: 2010年05月13日
*******************************************************************************/
public class SQLHelper
{
//设置连接字符串 —— SQL Server验证模式的连接字符串
//public static string strConn = @"server = PANLING;database = StudentMIS;uid = sa;pwd = sa";
//设置连接字符串 —— Windows验证模式的连接字符串
public static string strConn = @"server = T403-004\HB_SQLSERVER;database = DB_LibraryManage;Integrated Security = SSPI";
/// <summary>
/// 功能描述:执行ADO.NET增、删、改操作
/// </summary>
/// <param name="strText">输入参数 —— 要执行的SQL语句(命令文本)</param>
/// <param name="cmdType">输入参数 —— 要执行的SQL命令类型</param>
/// <param name="SqlParams">输入参数 —— 要执行的SQL语句中的参数列表(命令参数列表)</param>
/// <returns>返回执行影响的行数</returns>
public static int MyExecu
相关文档:
1.删除表
select 'drop table ' || table_name || ' purge;'
from user_tables
where length(table_name) <= 4;
删除带约束的表
Drop table 表名 cascade constraints;
2.查询view&同义词
--说明:可以根据视图的text_length ......
问题及描述:
--1.学生表
Student(S#,Sname,Sage,Ssex) --S# 学生编号,Sname 学生姓名,Sage 出生年月,Ssex 学生性别
--2.课程表
Course(C#,Cname,T#) --C# --课程编号,Cname 课程名称,T# 教师编号
--3.教师表
Teacher(T#,Tname) --T# 教师编号,Tname 教师姓名
--4.成绩表
SC(S#,C#,score) --S# 学生编号,C# 课程 ......
本文来自:http://hi.baidu.com/darkroot/blog/item/7b74be2cf06d76e78b139903.html
declare @tbName nvarchar(500)
declare @ct int
declare @csql nvarchar(500)
declare &n ......
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
impo ......
下载解压了Oracle SQL Developer工具,运行时,启动不了,报错信息如下:
---------------------------
Unable to create an instance of the Java Virtual Machine
Located at path:
<SQLDEVELOPER>\jdk\jre\bin\client\jvm.dll
---------------------------
是JVM参数设置的问题,我的解决方案如下:
<SQ ......