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);
}
相关文档:
先来了解一下链表模式的原理:
首先写一个JavaBean,内容是要添加的元素和该元素的节点。
public class NodeBean implements Serializable
{
private Object data; //元素本身
private NodeBean next; //下一个节点
&n ......
学习了几周,玩得很开心。
学习java的第一件事就是做一个程序生成Huffman编码。
在这里我学会了LinkedList的使用,它可以保存任何类型的对象。
如下是我的编码结构体
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package HuffmanTree;
......
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 ......
注意,请不要被我误导,我没有看其他资料,这是我自己分析的,有些可能是不对的
"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.1 面向对象的基本概念
面向对象的基本思想
面向对象是一种新兴的程序设计方法,或者是一种新的程序设计规范(paradigm),其基本思想是使用对象、类、继承、封装、消息等基本概念来进行
程序设计。从现实世界中客观存在的事物(即对象)出发来构造软件系统,并且在系统构造中尽可能运用人类的自然思维方式。开发 ......