jdbc update error

asked 2009-04-17 18:40:24 +0800

james gravatar image james
255 2

I am trying to insert some stuff into a database. I can query perfectly fine. I format the insert statement well.
i can print it out to the screen, copy and paste, and have it enter the data correctly into the database.
For some reason, when i use the update function, i get this error"The server is temporarily out of service.
Would you like to try again?".
And it also shuts down my Apache Tomcat service.

In the orderInsert function, if i comment out the update function call then I have no problems.
Any idea what might be causing this?

	public void update(String Qstatement) throws ClassNotFoundException, SQLException { //also for insert
	//load driver and get a database connection
	//Note: It is usually better to use connection pool. Please consult
	//the manual of your Web server. Or, refer to the Developer's Guide
		String url = "jdbc:mysql://"+DB_host+":"+DB_port+"/"+DB_database;
		Connection con = DriverManager.getConnection(url,"user", "");
		PreparedStatement stmt = con.prepareStatement(Qstatement);
		//execute the statement
		try {
			int rs = stmt.executeUpdate();
		} catch (SQLException se) {
			System.out.println("We got an exception while executing our query:" +
                     "that probably means our SQL is invalid");
		//close the jdbc connection

	public String orderInsert(String[] insertOrderArray) throws ClassNotFoundException, SQLException{
		Qstatement = "INSERT INTO weborders (SessionID, Confirmed, ClientID, BioRxID, OrderDate, OrderTime, PhysicianID, OrderedByID, ProductID, ProcedureID, PatientName, Weight, DeliveryDate, DeliveryTime, CalibrationDate, CalibrationTime, Amount, Units, Quantity, PONumber, Note, LastModified, Deleted) VALUES (";
		for (Integer num = 0; num < insertOrderArray.length; num++){
			Qstatement += insertOrderArray;
			if (insertOrderArray.length != 1 + num){
				Qstatement += ", ";
		Qstatement += ")";
		String sQstatement = Qstatement;
		return sQstatement;

delete flag offensive retag edit

13 Replies

Sort by ยป oldest newest

answered 2009-04-20 20:46:23 +0800

james gravatar image james
255 2

It's the same problem I have been having. The server times out and the service just stops.
The only message I get is the one caused by the service stopping...

The server is temporarily out of service.
Would you like to try again?

link publish delete flag offensive edit

answered 2009-04-21 13:34:29 +0800

YamilBracho gravatar image YamilBracho
1722 2

There something I did not see, test taking out the "System.exit(1);" statement...

link publish delete flag offensive edit

answered 2009-04-21 14:51:08 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16

have a look in his configuration files.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools




Asked: 2009-04-17 18:40:24 +0800

Seen: 479 times

Last updated: Apr 21 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More