QTPÊý¾Ý¿â¼ì²éµãÊÖ¶¯SQLд·¨
Ò»¡¢SQL Server¸ñʽ(±¾µØÎÞÐè°²×°SQL Server)
connectionstring(Á¬½Ó×Ö·û´®):
1.±¾µØûÓд´½¨Êý¾ÝÔ´µÄ·½Ê½
DRIVER=SQL Server;SERVER=Êý¾Ý¿âIPµØÖ·;UID=Óû§Ãû;PWD=ÃÜÂë;APP=Microsoft Office 2003;WSID=±¾µØÖ÷»úÃû;DATABASE=Êý¾Ý¿âÃû
ʵÀý£º
DRIVER=SQL Server;SERVER=10.160.11.10;UID=sa;PWD=sa;APP=Microsoft Office 2003;WSID=RJHLJUN;DATABASE=dcwork
2.±¾µØÒÑ´´½¨Êý¾ÝÔ´µÄ·½Ê½
DSN=Êý¾ÝÔ´Ãû³Æ;UID=Óû§Ãû;PWD=ÃÜÂë;APP=Microsoft Office 2003;WSID=Êý¾Ý¿âµÄÖ÷»úÃû;DATABASE=Êý¾Ý¿âÃû
ʵÀý£º
DSN=LocalServer;UID=sa;PWD=sa;APP=Microsoft Office 2003;WSID=RJDCWORKTEST;DATABASE=dcwork
3.SQLÓï¾äʵÀý(´ÓÊý¾Ý¿â±íHR_LANGUAGE_TYPEÖУ¬²éѯ×Ö¶ÎÓïÑÔÃû³ÆLANGUAGE_NAME£¬Ìõ¼þÓïÑÔÃû³Æ£½ÖÐÎÄ£¬°´ÓïÑÔÃû³ÆÉýÐòÅÅÐò½á¹û)
source(SQLÓï¾ä):
SELECT
HR_LANGUAGE_TYPE.LANGUAGE_NAME from dcwork.dbo.HR_LANGUAGE_TYPE
HR_LANGUAGE_TYPE WHERE (HR_LANGUAGE_TYPE.LANGUAGE_NAME='ÖÐÎÄ') ORDER BY
HR_LANGUAGE_TYPE.LANGUAGE_NAME
¶þ¡¢DB2¸ñʽ£º(±¾µØÖÁÉÙ°²×°DB2 Run-Time Client Lite)
connectionstring(Á¬½Ó×Ö·û´®):
1.±¾µØûÓд´½¨Êý¾ÝÔ´µÄ·½Ê½
DRIVER={IBM DB2 ODBC DRIVER};UID=Óû§Ãû;PWD=ÃÜÂë;MODE=SHARE;DBALIAS=Êý¾Ý¿âÃû;
ʵÀý£º
DRIVER={IBM DB2 ODBC DRIVER};UID=db2admin;PWD=db2admin;MODE=SHARE;DBALIAS=DCWORK;
2.±¾µØÒÑ´´½¨Êý¾ÝÔ´µÄ·½Ê½
DSN=Êý¾ÝÔ´Ãû³Æ;UID=Óû§Ãû;PWD=ÃÜÂë;MODE=SHARE;DBALIAS=DCWORK;
ʵÀý£º
DSN=DWCORKDB2;UID=db2admin;PWD=db2admin;MODE=SHARE;DBALIAS=DCWORK;
3.SQLÓï¾äʵÀý
source:SQLÓï¾ä
SELECT
HR_LANGUAGE_TYPE.LANGUAGE_NAME from DB2ADMIN.HR_LANGUAGE_TYPE
HR_LANGUAGE_TYPE WHERE (HR_LANGUAGE_TYPE.LANGUAGE_NAME='ÖÐÎÄ') ORDER BY
HR_LANGUAGE_TYPE.LANGUAGE_NAME
Èý¡¢Oracle¸ñʽ£º
connectionstring(Á¬½Ó×Ö·û´®):
1.±¾µØûÓд´½¨Êý¾ÝÔ´µÄ·½Ê½
DRIVER={Oracle
in
OraHome92};SERVER=Êý¾Ý¿â·þÎñÃû;UID=Óû§Ãû;PWD=ÃÜÂë;DBQ=Êý¾Ý¿âÃû;DBA=W;APA=T;EXC=F;
XSM=Default;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;GDE=F;FRL=Lo;BAM=IfAllSuccessful;MTS=F;MDI=Me;CSR=F;FWC=F;PFC=10;TLO=O;
´ò¿ªQTP
1.insert--checkpoint--database checkpoint
2.ÔÚµ¯³öÀ´µÄ´°¿ÚÑ¡ÔñµÚ¶þÏî specify SQL ....,È
Ïà¹ØÎĵµ£º
index.jsp
<%@ page language="java" import="java.sql.*" import="java.lang.*" import="java.util.*" pageEncoding="GB2312"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%!
& ......
Sql´úÂë
--²ÉÓÃSQLÓï¾äʵÏÖsql2005ºÍExcel Êý¾ÝÖ®¼äµÄÊý¾Ýµ¼Èëµ¼³ö£¬ÔÚÍøÉÏÕÒÀ´Ò»--Ï£¬ÊµÏÖ·½·¨ÊÇÕâÑùµÄ£º
--Excel---->SQL2005 µ¼È룺
select * into useinfo from O ......
import java.sql.*;
/*
* JAVAÁ¬½ÓACCESS£¬SQL Server,MySQL,OracleÊý¾Ý¿â
*
* */
public class JDBC {
public static void main(String[] args)throws Exception {
Connection conn=null;
//====Á¬½ÓACCESSÊý¾Ý¿â ......
1¡¢ÔÚÐèµ¼³öµÇ¼ÕʺŵÄSQL·þÎñÆ÷ÉÏÖ´ÐÐÒÔϲéѯÓï¾ä£º
USE master
GO
IF OBJECT_ID ('sp_hexadecimal') IS NOT NULL
DROP PROCEDURE sp_hexadecimal
GO
CREATE PROCEDURE sp_hexadecimal
@binvalue varbinary(256),
@hexvalue varchar(256) OUTPUT
AS
DECLARE ......