Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

doubt while trapping SQLException  RSS feed

 
charuta parth
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am doing something like this,

URLConnection connection = new URL(ServerURL+"/"+ ServerContextRoot+"/servlet/DataProvider").openConnection();
connection.setDoInput(true);
connection.setDoOutput(true);
connection.setUseCaches(false);
connection.setDefaultUseCaches(false);
connection.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
PrintWriter writer = new PrintWriter(connection.getOutputStream());
writer.print("insert query");

Now the problem is if query aqguemnt are insufficient, it dont throws SQLException.

What wrong i am doing here?
 
Varun Chopra
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what do you get instead? Are you getting any exception?
It is possible that code on the other side is catching SQLException and throwing some runtimeexception or no exception at all. Can you paste the code of DataProvider servlet?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!