Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JavaÍøÂçÁÄÌì·þÎñÆ÷¶Ë

//JavaÍøÂçÁÄÌì·þÎñÆ÷
import java.io.*;
import java.awt.*;
import java.net.*;
import java.util.*;
import java.awt.event.*;
public class ServerFrame extends Frame implements ActionListener{
int ScreenWidth,ScreenHeight;
Button CloseServer;
TextArea ServerStatus;
ServerThread sThread;
public ServerFrame(){
super("ÓÎÏ··þÎñÆ÷");
ServerStatus = new TextArea();
CloseServer = new Button("¹Ø±Õ·þÎñÆ÷");
ServerStatus.setEditable(false);
CloseServer.addActionListener(this);
add(ServerStatus,BorderLayout.CENTER);
add(CloseServer,BorderLayout.SOUTH);
ScreenWidth = getToolkit().getScreenSize().width;
ScreenHeight = getToolkit().getScreenSize().height;
setSize(ScreenWidth/2,ScreenHeight /2);
setLocation((ScreenWidth - getWidth())/2,
(ScreenHeight - getHeight())/2);
setResizable(false);
setVisible(true);
sThread = new ServerThread(this);
sThread.start();
}
public static void main(String[] args){
new ServerFrame();
}
public void actionPerformed(ActionEvent e){
dispose();
System.exit(0);
}
}
class ServerThread extends Thread{
int sPort;
ServerSocket sSocket;
ServerFrame frame;
TextArea sStatus;
Vector Clients;
Vector messages;
BroadCast BroadCastWriter;
CleanDeadConnect Cleaner;
public ServerThread(ServerFrame f){
Clients = new Vector();
messages = new Vector();
try{
sPort = 6633;
sSocket = new ServerSocket(sPort);
}catch(IOException E){
System.out.println("·¢ÉúÒì³£: "+E);
System.out.println("ÎÞ·¨½¨Á¢·þÎñÆ÷½Ó¿Ú£¡£¡");
System.exit(1);
}
this.frame = f;
sStatus = frame.ServerStatus;
sStatus.append("ÓÎÏ··þÎñÆ÷ÒÑÆô¶¯..\n\n"


Ïà¹ØÎĵµ£º

JAVAÁ¬½ÓÊý¾Ý¿â´óÈ«

 oracle
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String url="jdbc:oracle:thin:@localhost:1521:orcl";
String user="scott";
String password="tiger";
Connection conn= DriverManager.getConnection(url,user,password);
Statement stmt=conn.createStatement(ResultSet.TYPE_S ......

Éî¿ÌÀí½âJava±à³ÌµÄ7¸öÀý×Ó

 Éî¿ÌÀí½âJava±à³ÌµÄ7¸öÀý×Ó   Ù¡Ç¿ 2009Äê11ÔÂ7ÈÕ http://blog.csdn.net/microtong
 1. ÔĶÁÏÂÁдúÂë»Ø´ðÎÊÌ⣨µÚÒ»¸öJava³ÌÐò£¬Àí½âPATHºÍCLASSPATH£¬Ñ§»áʹÓÃjavacºÍjavaÃüÁ
view plaincopy to clipboardprint?
package cn.edu.uibe;  
public class HelloWorld {  
......

javaÔËÐÐÓ¦ÓóÌÐò

ÔËÐÐÓ¦ÓóÌÐòÓëÔËÐÐweb³ÌÐòÔ­ÀíÊÇÒ»Öµģ¬Ö»²»¹ýwebÓ¦ÓóÌÐòÒѾ­ÔÚÆô¶¯Ê±½«³ÌÐòÔËÓõÄjar°üÉèÖõ½»·¾³±äÁ¿ÀӦÓóÌÐò¿ÉÒÔ×Ô¼ºÐ´¸öÅú´¦ÀíÀ´ÉèÖû·¾³±äÁ¿£º
java -classpath ./lib/application.jar;./lib/hibernate3.jar -Xms608m -Xmx608m com.zyj.application.StartUp
pause/exit
ÆäÖÐapplication.jarΪӦÓóÌÐòµÄjar° ......

CÓïÑÔºÍJAVAÒ»Ñù£¬º¯Êý²ÎÊý´«µÝ·½Ê½¶¼ÎªÖµ´«µÝ·½Ê½

¶¨Òå°´Öµ´«µÝºÍ°´ÒýÓô«µÝÕâÁ½¸öÊõÓïÊÇÖØÒªµÄ¡£
°´Öµ´«µÝÒâζ×ŵ±½«Ò»¸ö²ÎÊý´«µÝ¸øÒ»¸öº¯Êýʱ£¬º¯Êý½ÓÊÕµÄÊDzÎÊýµÄÒ»¸ö¸±±¾¡£Òò´Ë£¬Èç ¹ûº¯ÊýÐÞ¸ÄÁ˸òÎÊý£¬½ö¸Ä±ä¸±±¾£¬¶øԭʼֵ±£³Ö²»±ä¡£°´ÒýÓô«µÝÒâζ×ŵ±½«Ò»¸ö²ÎÊý´«µÝ¸øÒ»¸öº¯Êýʱ£¬º¯Êý½ÓÊÕµÄÊDzÎÊýµÄÄÚ´æµØÖ·£¬¶ø²»ÊDzÎÊýµÄ¸±±¾¡£Òò ´Ë£¬Èç¹ûº¯ÊýÐÞ¸ÄÁ˸òÎÊý£¬µ÷ ......

JavaʵÏÖ¼¸ÖÖ³£¼ûÅÅÐò·½·¨£¨ÉÏ£©

 ÈÕ³£²Ù×÷Öг£¼ûµÄÅÅÐò·½·¨ÓУºÃ°ÅÝÅÅÐò¡¢¿ìËÙÅÅÐò¡¢Ñ¡ÔñÅÅÐò¡¢²åÈëÅÅÐò¡¢Ï£¶ûÅÅÐò£¬ÉõÖÁ»¹ÓлùÊýÅÅÐò¡¢¼¦Î²¾ÆÅÅÐò¡¢Í°ÅÅÐò¡¢¸ë³²ÅÅÐò¡¢¹é²¢ÅÅÐòµÈ¡£
ðÅÝÅÅÐòÊÇÒ»ÖÖ¼òµ¥µÄÅÅÐòËã·¨¡£ËüÖظ´µØ×߷ùýÒªÅÅÐòµÄÊýÁУ¬Ò»´Î±È½ÏÁ½¸öÔªËØ£¬Èç¹ûËûÃǵÄ˳Ðò´íÎó¾Í°ÑËûÃǽ»»»¹ýÀ´¡£×ß·ÃÊýÁеŤ×÷ÊÇÖظ´µØ½øÐÐÖ±µ½Ã»ÓÐÔÙÐèÒª½» ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ