JSPÖÐÁ¬½ÓSQL 2000Êý¾Ý¿âµÄÎÊÌâ×ܽá
ÓÉÓÚϵͳÐèÇó£¬×î½üÔÚ¿ª·¢¹ý³ÌÖн«ÏµÍ³´ÓÔÀ´µÄMySQLתÒƵ½SQL
2000Ï£¬ÆäÖÐÓöµ½ÁËÖî¶àÎÊÌ⣬»¨·ÑÁËÎÒ²»ÉÙʱ¼ä¡£ÏÖÔÚ°ÑÎҵľÑéÄóöÀ´¸æËß´ó¼Ò£¬ºÃÈôó¼ÒÉÙ×ßÍä·£¬½ÚԼʱ¼ä¡£
¡¡¡¡Ê×ÏÈÊÇSQL
2000Êý¾Ý¿âµÄ°²×°ÎÊÌ⣬ÔÚ´ËÎÒÖ÷Òª½²Ð©¹ØÓÚSQL 2000µÄ°æ±¾Óë²Ù×÷ϵͳµÄ¼æÈÝÐÔÎÊÌ⣺SQL
2000×ܹ²ÓÐ7¸ö²»Í¬°æ±¾£¬ÊÊÓ¦²»Í¬µÈ¼¶Óû§µÄÐèÇó¡£
¡¡¡¡ÎÒÊÔÁËһϣ¬ÔÚXPϵͳÏÂÖ»ÓГ¸öÈË¿ª·¢°æ”ÄÜÕý³£°²×°¶ø²»³öÏÖ´íÎó£¬ËùÒÔ´ó¼ÒÔÚ°²×°Ê±Òª×¢Ò⣬¾ßÌ尲װʱµÄÅäÖòÎÕÕÏà¹Ø˵Ã÷¾Í¿ÉÒÔÁË¡£
¡¡¡¡ÏÂÃæ˵Ã÷ÈçºÎÁ¬½Óµ½SQL
2000Êý¾Ý¿â£¬Ê×Ïȵ±È»ÊÇÒªÏÂÔØJDBCÇý¶¯³ÌÐò£¬×îºÃȥ΢Èí¹Ù·½ÍøÕ¾ÏÂÔØ£¬È»ºó½«ÏÂÔص½µÄÈý¸öJAR°ü·ÅÈëÄãµÄWEBÓ¦ÓõÄWEB-INF/lib/Ï¡£½ÓÏÂÀ´±àд³ÌÐò½øÐвâÊÔ:
/***********************************************
/*
/*DBTest.java
/*
/******************************************* */
import java.sql.*;
public class DBTest
{
Connection con;
Statement sta;
ResultSet rs;
String driver;
String url;
String user;
String pwd;
public DBTest()
{
driver = "com.microsoft.jdbc.
sqlserver.SQLServerDriver";;
url = "jdbc:microsoft:sqlserver:
//localhost:1433;DatabaseName =test";
//testΪÊý¾Ý¿âÃû
user = "sa";
pwd = "sa";
//Çë¸ü¸ÄΪÄãÏàÓ¦µÄÓû§ºÍÃÜÂë
init();
}
public void init()
{
try{
Class.forName(driver);
System.out.println("driver is ok");
con = DriverManager.
getConnection(url,user,pwd);
System.out.println("conection is ok");
sta = con.createStatement();
rs = sta.executeQuery
("select * from room");
while(rs.next())
System.out.println
(rs.getInt("roomNum"));
}catch(Exception e)
{
e.printStackTrace();
}
}
public static void main(String args£Û£Ý)
//×Ô¼ºÌæ»»£Û£Ý
{
new DBTest();
}
}
¡¡¡¡°´µÀÀí½²£¬ÉϱßÕâ¶Î´úÂëÓ¦¸Ãû´í£¬¿ÉÊ×ÏÈÎÒÃÇÀ´¿´Ò»Ï£¬Èç¹ûsqlser·þÎñÆ÷ûÓÐÉý¼¶µ½sp3£¨ÔÚʹÓÃjdbcʱ£¬Èç¹ûϵͳÊÇxp»òÕß
Ïà¹ØÎĵµ£º
1.²»ÓÃÍ˳öSQL2000°²×°³ÌÐò,Ö±½ÓÇл»µ½×ÀÃæ.
¡¡¡¡2.´ò¿ª×¢²á±í±à¼Æ÷£¨ÔÚ“ÔËÐДÖÐÇÃÈë“regedit”Ö®ºó»Ø³µ¼´¿É£©£¬¶¨Î»µ½×¢²á±íµÄHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager½Úµã.
¡¡¡¡3.µ¥»÷“Session Manager”Õâ¸ö½Úµã£¬ ......
ORACLEÊý¾Ý¿âÀï±íµ¼ÈëSQL ServerÊý¾Ý¿â
1¡¢ÔÚÄ¿µÄSQL ServerÊý¾Ý¿â·þÎñÆ÷ÉÏ°²×°ORACLE ClientÈí¼þ»òÕßORACLE ODBC Driver.
ÔÚ$ORACLE_HOME\network\admin\tnsnames.oraÀïÅäÖÃORACLEÊý¾Ý¿âµÄ±ðÃû(service name)¡£
2¡¢ÔÚWIN2000»òÕßwin200 ......
/*µ±Ö´ÐÐSQLʱ·¢ÏÖ²»ÄÜÁ¬½ÓÊý¾Ý¿â£¬ÏÈÖØÁ¬Ò»´Î*/
import java.io.FileInputStream;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
......
1.Óà CUBE »ã×ÜÊý¾Ý
CUBE ÔËËã·ûÉú³ÉµÄ½á¹û¼¯ÊǶàάÊý¾Ý¼¯¡£¶àάÊý¾Ý¼¯ÊÇÊÂʵÊý¾ÝµÄÀ©Õ¹£¬ÊÂʵÊý¾Ý¼´¼Ç¼¸ö±ðʼþµÄÊý¾Ý¡£À©Õ¹½¨Á¢ÔÚÓû§´òËã·ÖÎöµÄÁÐÉÏ¡£ÕâЩÁб»³ÆΪά¡£¶àάÊý¾Ý¼¯ÊÇÒ»¸ö½á¹û¼¯£¬ÆäÖаüº¬Á˸÷ά¶ÈµÄËùÓпÉÄÜ×éºÏµÄ½»²æ±í¸ñ¡£ CUBE ÔËËã·ûÔÚ SELECT Óï¾äµÄ GROUP BY ×Ó¾äÖÐÖ¸¶¨¡£¸ÃÓï¾äµÄÑ¡ÔñÁбíÓ ......
³ö´¦£ºhttp://www.w3school.com.cn/sql/sql_alter.asp ALTER TABLE Óï¾ä ALTER TABLE Óï¾äÓÃÓÚÔÚÒÑÓеıíÖÐÌí¼Ó¡¢Ð޸Ļòɾ³ýÁС£ SQL ALTER TABLE Óï·¨ ÈçÐèÔÚ±íÖÐÌí¼ÓÁУ¬ÇëʹÓÃÏÂÁÐÓï·¨: ALTER TABLE table_name
ADD column_name datatype
Ҫɾ³ý±íÖеÄÁУ¬ÇëʹÓÃÏÂÁÐÓï·¨£º
ALTER TABLE table_name
DROP COLUM ......