JTable bound to a database with lazy loading

I’ve been doing experiments with JTables bound to database tables in the past. But I was not satisfied with the result to be honest. The pagination helps but there is still noticeable pauses each time a database query has to be issued. So I started looking into other possibilities. I come up with the idea of doing lazy loading and presenting some fake data until the data is really retrieved from the database, I did a small proof of concept and seems to work ok. ...

January 13, 2010

Two web applications sharing the same Derby database

I just realized that to be able to open/share the same Derby database from two different web applications running in the same Tomcat instance (same JVM) you’ll need to put derby.jar in the $TOMCAT_HOME/common/lib and remove it from your applications WEB-INF/lib. I got the clue from this RIFE web page the jarfiles you need are derby.jar and derbytools.jar . Due to classloader peculiarities, don’t copy them to your application’s web/WEB-INF/lib/ subdirectory, or to Tomcat’s shared/lib/ directory. Tomcat’s common/lib/ directory works, and probably common/endorsed/ does too. ...

October 15, 2007

Enhanced JDBC Sampler for Apache JMeter

I’ve moved this post to the following page. **UPDATE**: The files here will only run in JRE 1.6. I will try to provide JRE 1.5-compatible files as soon as possible. Thanks to Daniel for pointing this out. Some time ago I posted a bug report for Apache JMeter benchmarking utility (you can find my other jmeter bug reports here) . The bug report contains an enhancement of the current JDBC Sampler to allow JMeter to invoke PreparedStatements and also to change the way Callable Statements are handled to avoid performance problems when using some JDBC drivers (mainly Sybase). Because I don't know if this bug report will ever be integrated in JMeter or when. I decided to release this "Enhanced JDBC Sampler" as a JMeter plugin. The **installation** is quite simple just unzip the EnhancedJdbcSampler.zip and put the `EnhancedJdbcSampler.jar` file in the `$JMETER_HOME/lib/ext` directory. Once you restart JMeter you should see a new option under Add -> Samplers called "Enhanced JDBC Request". It works just like the old JDBC Sampler (see docs on how to use JDBC sampler here and here). The difference with the conventional JDBC Sampler is that you now have more options under *Query type* and there are two new text boxes at the bottom of the page. In the first box, you write the param values, and in the second box you write the param types. See the image below for an example. In this example there are two parameters: the literal `1` and the variable `${A}`. (In this particular case the ${A} comes from a Counter). The type of both parameters is INT. Check the list of JDBC Types.

December 14, 2006