Geoffrey Ren

Greenhorn
+ Follow
since Nov 25, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Geoffrey Ren

class T3
{
public static void main(String[] args)
{
T2 t2 = new T2();
t2.start();
System.out.println("hmm");
}
}
public class T1 extends Thread
{
public synchronized void run()
{
while(true)
{
System.out.println("t1 run start");
try
{
System.out.println("t1 wait");
wait();
}
catch(InterruptedException e)
{
System.out.println("e");
}
System.out.println("t1 woke up..............");
}
}

}
class T2 extends Thread
{
T1 t1;

public synchronized void run()
{
t1 = null;
while(true)
{
System.out.println("t2 run start");
try
{
t1 = new T1();
t1.start();

sleep(500);
}
catch(InterruptedException e)
{
}
System.out.println("invoke the t1 thread!!");
synchronized(t1)
{
t1.notifyAll();
}

}
}
}
when I got the user inputting. For example, user input the value "test's"/"test&s"/"test\s". How to insert the value into oracle DB by jdbc.
Thanks for you reply!
when I got the user inputting. For example, user input the value "test's"/"test&s"/"test\s". How to insert the value into oracle DB by jdbc.
Thanks for you reply!
19 years ago
when I got the user inputting. For example, user input the value "test's"/"test&s"/"test\s". How to insert the value into oracle DB by jdbc.
Thanks for you reply!
Thanks!
19 years ago
how to detect the servlet wheather it was initialized.
19 years ago
When I started the weblogic. I want to initialize all of servlet. How shoul I implement this function.
Thanks!
19 years ago
I think this problem is very monstrosity. I resarched all of material. I can't find any key.
I wanted superior can help me settle the problem. Our project will be end. I will very malformation if this problem can't be settled.
Thanks!!
19 years ago
It is class which implements the Serializable interface.
19 years ago
my applet interact with the webserver by HTTP protocol. I need to get a object from server.
But when I used the ObjectInputStream object readObject method. It throw a exception:
Server code:
ObjectOutputStream objout = new ObjectOutputStream(response.getOutputStream());
response.setContentType("application/octet-stream");

if (result.size() > 0)
{
for (int i = 0; i < result.size(); i++)
{
objout.reset();
objout.writeObject(result.get(i));
objout.flush();
}
}
else
{
Lesson lesson = new Lesson();
objout.writeObject(lesson);
objout.flush();
}
It is right.
Client code:
ObjectInputStream read = new ObjectInputStream(socket.getInputStream());

System.out.println("Get the outputing object2");

Vector result = new Vector();
Lesson lesson = null;
while ((lesson = (Lesson)read.readObject()) != null)
{
result.add(lesson);
}
writer.close();
socket.close ();
It meet problem:
The exception:
java.io.StreamCorruptedException: InputStream does not contain a serialized object
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:849)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:168)
at test.TestGet.main(TestGet.java:56)
HTTP/1.0 200 OK
Date: Wed, 05 Mar 2003 13:57:00 GMT
Server: WebLogic WebLogic Server 7.0 Thu Apr 25 17:16:22 PDT 2002 180709
Content-Type: application/octet-stream
Connection: Close
19 years ago
try
{
String urlString = "http://localhost:8080/esp/SearchLesson";
URL url = new URL(urlString);

int port = url.getPort ();

if (port == -1)
{
port = 80;
}

socket = new Socket(url.getHost (), port);

out = socket.getOutputStream ();
InputStream in = socket.getInputStream();

Writer writer = new OutputStreamWriter (out, "ISO-8859-1");

writer.write ("POST " + url.getFile () + " HTTP/1.0\r\n");

String contentType = "application/x-www-form-urlencoded";

writer.write ("Content-type: " + contentType + "\r\n");

String condition = "userid = 'test'";;

Vector result = new Vector();
ObjectInputStream read = new ObjectInputStream(in);
writer.write ("Content-length: " + condition.length() + "\r\n\n");
writer.write(condition);
writer.flush ();
while ((result = (Vector)read.readObject()) != null)
{
return result;
}
socket.close ();
writer.close();
}
catch (ClassNotFoundException nf)
{
nf.printStackTrace();
}
catch (StreamCorruptedException se)
{
se.printStackTrace();
}
catch (IOException ex)
{
ex.printStackTrace() ;
try
{
if (socket != null)
{
socket.close ();
}
}
catch (IOException ignored)
{
throw new IOException("operation failure");
}
}

which throw the exception:
java.io.StreamCorruptedException: Caught EOFException while reading the stream header
at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
at java.io.ObjectInputStream.<init>(Unknown Source)
at com.esp.courseware.util.SCORMUtils.getLessonListByCondition(SCORMUtils.java:368)
at com.esp.gui.fwk.controller.TableViewController.actionPerformed(TableViewController.java:679)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Please help me!!!
Hi, I meet a problem. when I modified a column value. If mouse did not exchange the row count. The tablemodel's setValueAt will not touched off.
I can't get the current row,current current column value. How do i get the value?
19 years ago
I used applet as client. I transfer some parameters to servlet by HTTP. Servlet search some data from DB(List). how do I get the List data. (I want to get the List object).
I make a JSplitPane. place a jtree in left. place a JPanel in right. I had configed "splitPane.setOneTouchExpandable(true)". But I can't change the size of right and left by mouse.

thanks!!!
19 years ago