- 浏览: 131096 次
- 性别:
- 来自: 南京
最新评论
-
isca:
第25行的>应该是$ ,要不然无法执行命令。。。。
Java实现telnet远程调用脚本 -
arne3166:
iteye的页面的左侧菜单被挤到下方去了,这是我在ie8的一个 ...
反射实现 AOP 动态代理模式(Spring AOP 的实现 原理) - Java 例子 - -
arne3166:
这是一篇学习的文档,从来没有在项目中用过,了解了一下其基本的使 ...
反射实现 AOP 动态代理模式(Spring AOP 的实现 原理) - Java 例子 - -
zhangyouzhi:
好,学习了。
Struts2 ——1、从零开始解释 -
helloghui:
select * from xxxx for update;
...
数据库如何锁表
文章列表
import java.io.*;
public class MethodTest {
static PrintWriter out = new PrintWriter(System.out, true);//创建一个打印流
public static void main(String[] args) {
FirstThread first = new FirstThread();//创建一个线程first
SecondThread second = new SecondThread();//创建一个线程second
first.start();//启动线程fir ...
import java.net.*;
import java.io.*;
public class RunnableDemo {
public static void main(String args[]) {
ServerSocket s = null;
Socket s1;
String sendString = "Hello Net World!";
OutputStream s1out;
DataOutputStream dos;
try {
s = new ServerSocket(5432) ...
class DataObject {
int dataItem1;
int dataItem2;
DataObject() {
dataItem1 = 50;
dataItem2 =50;
}
void itemSwap() {
int x = (int)( -4.999999+Math.random() * 10);
dataItem1 -= x;
keepBusy( 10 );
dataItem2 += x;
}
void test() {
int sum = dataItem1 + dataItem2;
Syste ...
import java.io.*;
class DataFile {
public DataFile() {
try {
FileIO.writeOneString( "Hello ","zliner.txt");
}catch( FileIOException e) {}
}
void fileIO() {
try {
String str = FileIO.readOneString( "zliner.txt" );
FileIO.writeOneString( str, ...
class DataObject {
int dataItem1;
int dataItem2;
DataObject() {
dataItem1 = 50;
dataItem2 = 50;
}
synchronized void itemSwap() {
int x = ( int )( -4.999999 + Math.random() * 10 );
dataItem1 -= x;
keepBusy( 10 );
dataItem2 += x;
}
synchronized void test() {
int sum ...
public class HoldIntegerSynchronized
{
private int sharedInt=-1;
private boolean writeable=true;
public synchronized void setSharedInt(int val)
{
while(!writeable)
{
try
{
wait();
}
catch(InterruptedException e)
{
e.printStackTrace();
}
}
...
public class ConsumeInteger extends Thread
{
private HoldIntegerUnsynchronized cHold;
public ConsumeInteger(HoldIntegerUnsynchronized h)
{
super("ConsumeInteger ");
cHold=h;
}
public void run()
{
int val,sum=0;
do
{
try
{
Thread.sleep((i ...
生产和消费
import java.io.*;
public class WaitPandC {
static int produceSpeed = 200;
static int consumeSpeed = 200;
public static void main(String[] args) {
if(args.length > 0) {
produceSpeed = Integer.parseInt(args[0]);
}
if(args.length > 1) {
consumeSpeed = Integer.parseI ...
三个并发线程
public class ThreadBasic extends Thread {
String message;
ThreadBasic (String message) {//类ThreadBasic的构造函数
this.message=message;
}
public void run() {//实现重定义父类的run方法
// int sleeptime=(int)(Math.random()*3000);
// try{
// sleep(sleeptime);//睡眠
// }catch(Interrupt ...
多线程问题
import java.io.*;
public class WithThread {
static PrintWriter out = new PrintWriter(System.out, true); //创建一个打印流
public static void main(String[] args) {
ThreadPseudoIO pseudo = new ThreadPseudoIO();
pseudo.start();
showElapsedTime("Another task starts");
}
stati ...
Java中单线程的写法
import java.io.*;
public class WithoutThread {
static PrintWriter out = new PrintWriter(System.out, true);
public static void main(String[] args) {
NoThreadPseudoIO pseudo = new NoThreadPseudoIO();
pseudo.run();
showElapsedTime("Another task starts");
}
stat ...
package com.tools;
import java.util.Map;
import javax.wsdl.Definition;
import org.apache.axis2.description.AxisService;
import org.apache.axis2.tool.codegen.WSDL2JavaGenerator;
import org.apache.axis2.tool.codegen.eclipse.util.WSDLPropertyReader;
import org.apache.axis2.wsdl.codegen.CodeG ...
1、导入包!
服务端
2、写好一个JavaClass的例子
a、写好pojo类
User类
package com.bean;
public class User
{
private String userName;
public String getUserName()
{
return userName;
}
public void setUserName(String userName)
{
this.userName = userName;
...
今天对照着《Agile Web Development with Rails》,在cmd中输入入:...\depot> mysql depot_development <db/create.sql,提示错误:ERROR: 1045 <28000>: Access denied for user 'ODBC'@'localhost'[/email] <using password: NO>.解决方法一:运行MySQL Server Instance Configuration Wizard,在“Please set the security options”一步 ...