JAVA 连接 SQLServer 2000.
JAVA 连接 SQLServer 2000 所需要的三个JAR包。
http://download.csdn.net/source/2283940
----------------
Code:
------------------------
Connection conn = null;
Statement sta = null;
try {
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
if (conn == null || conn.isClosed()) {
conn = DriverManager.getConnection(
"jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=pubs","sa", "");
}
sta = conn.createStatement();
ResultSet rs = sta.executeQuery("select * from jobs ");
while (rs.next()) {
System.out.print(rs.getInt(1) + "\t");
System.out.print(rs.getString(2) + "\t");
System.out.print(rs.getString(3) + "\t");
System.out.println(rs.getString(4));
System.out.println("--------------------------");
}
} catch (Exception e) {
System.out.println(e);
}
相关文档:
<!--
@page { margin: 0.79in }
P { margin-bottom: 0.08in }
PRE.western { font-family: "Nimbus Roman No9 L" }
PRE.cjk { font-family: "Nimbus Roman No9 L" }
H1 { margin-bottom: 0.08in }
H1.western { font-family: "Nimbus Sans L", sans-ser ......
注意,请不要被我误导,我没有看其他资料,这是我自己分析的,有些可能是不对的
"DestroyJavaVM" prio=6 tid=0x00316800 nid=0x448 waiting on condition [0x00000000
..0x00a0fd4c]
java.lang.Thread.State: RUNNABLE
"Thread-1" prio=6 tid=0x02f85000 nid=0xd18 waiting for m ......
一、抽象类注意事项:
1,抽象类中可以用0+个抽象方法。
2,有抽象方法的的类必须是抽象类。
3,抽象类派生的非抽象子类必须实现抽象类中定义的所有抽象方法。
4,抽象类不能创建对象。
5,abstract 不能与final并列修饰同一个类
6,abstract不能与private,static ,final,native并列修饰同一方法。
package com.wens ......
JAVA的容器---List,Map,Set
Collection
├List
│├LinkedList
│├ArrayList
│└Vector
│ └Stack
└Set
Map
├Hashtable
├HashMap
└WeakHashMap
Collection接口
Collection是最基本的集合接口,一个Collection代表一组Object,即Collection的元素(Elements)。一些 Collection允许相 ......