`
文章列表
下载、安装SqlServer 2000 for JDBC驱动程序: 引用页 http://www.microsoft.com/china/sql/downloads/2000/jdbc.asp 将目录: C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib 下的三个jar包拷贝到目录: K:\tomcat\shared\lib 创建数据库: USE master GO CREATE DATABASE [mydata] ON (NAME = N'mydata_1', FILENAME = N'K:\sqlserver\myd ...
K:\tomcat\conf\tomcat-users.xml <?xml version='1.0' encoding='utf-8'?><tomcat-users> <role rolename="tomcat"/> <role rolename="role1"/> <role rolename="manager"/> <user username="tomcat" password="tomcat" roles="t ...
本文包括如下内容: 匿名访问test:修改root密码:创建一个新用户:限制用户权限到表和列:一个用户将自己所拥有的权限赋给另一个用户:取消用户权限:删除一个用户:使用mysqldump备份一个数据库:使用mysqldump备份一个或多个表:从备份文件恢复一个数据库: 匿名访问test: C:\>mysql -h localhost testWelcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 6 to server version: 4.0.20a-debug Typ ...
ClassLoaderDemo.java: package test; class SuperLoader { int i = setI(); static int j = setJ(); int z; SuperLoader() { System.out.println("SuperLoader @ constructor @ z 2 initialized."); this.z = 5; } public int setI() { System.out.println("SuperLoader @ i @ initialized."); return ...
package tigers; import java.util.*; public class Tiger13 {static interface TestListener extends EventListener {public void doEvent(TestEvent ev);}static class TestEvent extends EventObject {public TestEvent(Object source) {super(source);}}static class Test {private HashSet<TestListener> listene ...
Test1.java: package test; import java.io.*;import java.lang.reflect.*; class AClassLoader extends ClassLoader { public Class loadClass(String name, boolean resolve) throws ClassNotFoundException { Class klass = null; try { klass = findLoadedClass(name); //检查该类是否已经被装载。 if (klass != null) { return klas ...
package tigers; public class Tiger14 { public static void main(String[] args) {int[] timesArray = {10, 100, 1000, 10000};execute("java.lang.StringBuffer", timesArray);execute("java.lang.String", timesArray);execute("java.lang.Object", timesArray);}private static void exe ...
package tigers; import java.io.*; public class Tiger19 { public static void main(String[] args) {try {for (char c = 'A'; c <= 'Z'; c++ ) {String dirName = c + ":\\";long freeSpace = getFreeDiskSpace(dirName);if (freeSpace != -1) {long number = Math.round(freeSpace / (1024.00 * 1024.00)); ...
package tigers; import java.text.*;import java.util.*; public class Tiger25 { public static void main(String[] args) { System.out.println(getDateTime(new Date(), Locale.CHINA)); System.out.println(getDateTime(new Date(), Locale.CHINESE)); System.out.println(getDateTime(new Date(), Locale.SIMPLIFIED_ ...
package test; import java.util.*; public class Tiger9 {static class LinkedList {private Node header;private int size;public LinkedList() {header = new Node(null, null);size = 0;}public void add(Object o) {Node n = new Node(o, header); //关键步骤。创建一个新的Node对象,它的next变量将指向添加它之前的header对象。header = n; //使新创建的N ...
/** 创建日期 2005-2-5** TODO 要更改此生成的文件的模板,请转至* 窗口 - 首选项 - Java - 代码样式 - 代码模板*/ /*** @author bitan** TODO 要更改此生成的类型注释的模板,请转至* 窗口 - 首选项 - Java - 代码样式 - 代码模板*/public class Test4 { class Digital { private final int initSize; private final int increase; private Object[] arrays; private int items; private i ...
package tigers; class Super{ protected String name; public Super(String name) { this.name = name; } public void append(int ch) {//do nothing } public String getName() { return this.name; }}public class Tiger35 { public Super getSuper(String name) {return new Super(name) { public void append(int ch) { ...
package test; public class Tiger6 {static class Inner {private static Inner instance = null;private Inner() { //每调用一次构造函数,打印一条消息。System.out.println("create a Inner object!");}public static Inner getInstance() {if (instance == null) {instance = new Inner();} ...
package test; public class Test2 { static class Inner1 { public void m1() {synchronized("aaaa") { for (char c = 'a'; c <= 'g'; c++) { System.out.println(Thread.currentThread().getName() + " m1() : " + c); try { Thread.sleep(100); } catch (InterruptedException e) { } } } } pu ...
package test; public class Tiger3 {static class Inner {private Thread thread = null;private int count = 0;public synchronized void getLock() {while(tryGetLock() == false) { //无限循环,如果没有其他线程通过释放锁来唤醒它,它永不会退出,因为它无法自己终止while循环。当别的线程调用notify()释放锁后,它会继续执行这次wait()以后的代码,也即会再一次调用tryGetLock()方法来尝试获得锁。System.out ...
Global site tag (gtag.js) - Google Analytics