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);
}
相关文档:
windows xp下配置JDK环境变量:
1.安装JDK,安装过程中可以自定义安装目录等信息,例如我们选择安装目录为D:\java\jdk1.5.0_08;
2.安装完成后,右击“我的电脑”,点击“属性”;
3.选择“高级”选项卡,点击“环境变量”;
&nb ......
<!--
@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 ......
通配符 说明
_ 与任意单字符匹配
% 与包含一个或多个字符的字符串匹配
[ ] 与特定范围(例如,[a-f])或特定集(例如,[abcdef])中的任意单字符匹配。
[^] 与特定范围(例如,[^a-f])或特定集(例如,[^abcdef])之外的任意单字符匹配。
......
import java.io.*;
public class TestMusic{
private AudioFormat format;
private byte[] samples;
public static void main(String args[])throws Exception{
TestMusic sound =new TestMusic("1.wav");
InputStream stream =new ByteArrayInputStre ......