• Post Reply Bookmark Topic Watch Topic
  • New Topic

addBatch() function gives "java.lang.UnsupportedOperationException"  RSS feed

 
naveen b
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am having problem when using statement.addBatch().
It works fine when I run it from DOS.
But it gives me error when using in JSP.
I am using a set of insert statements which get data dynamically.
Thanks in Advance.
 
Marco Barenkamp
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
it's definitly a driver problem. Make sure that you use the same driver in your web app. What driver do you use?
------------------
Marco Barenkamp
____________________________________________
L M I N T E R N E T S E R V I C E S AG
Senior Trainer & Architect,
BEA Certified Enterprise Developer
Sun Certified Programmer for the Java2 Platform
Sun Certified Web Component Developer for the Java2 Platform
Sun Certified Developer for the Java 2 Platform
Sun Certified Enterprise Architect for the Java 2 Platform Enterprise Edition (PI)
 
sandeep balyan
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Ialso have problem..
I want to run a batch file using JSP which is on my host side
pls make u r discussion clear ..
as I can also have some help
bye and take care
sandeep
 
sandeep balyan
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Ialso have problem..
I want to run a batch file using JSP which is on my host side
pls make u r discussion clear ..
as I can also have some help
bye and take care
sandeep
 
Rehan Malik
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What Marco is suggesting is that the problem is more with the JDBC driver that you are using. It may not support the "addBatch()" method.
 
naveen b
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using JDBC ODBC driver. May be its with the drivers.
but the point to be noticed here is that , I created a class file with same commandes (just copied the same content into the class) then compiled and ran. It worked perfectly and inserted the records. I am having problem when inserting using JSP page.
Thank You all.
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using the same drivers? And are you sure?

Many servlet runners do not use System CLASSPATH settings, so ensure that the appropriate version of your database driver is in the classpath of your servlet runner. For example: Tomcat 4.0.x does not use system CLASSPATH, but it will load anything you put under <tomcat-home>/common/lib

If you had an older version of the driver in this directory, but a newer one in your system CLASSPATH, you'd potentially get the behaviour you describe. (works for plain classes, but not through servlets)
 
naveen b
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am sorry I did not give the exact picture of the environment I am using. I am using Webshere and only JSP pages and Beans for the application.
As you said, I am using different drivers in my webserver and jsp page. In My JSP page I am suing JDBC:ODBC where as my webshere uses JDBC:idbDriver(I never noticed this as my pages have been working fine till now).
So, Do you suggest that I should change the driver in WEBSHERE OR IN THE JSP PAGE.
Thanks,
NAVEEN.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!