Java
Query SQL Server stored procedure text with JDBC
I needed to quickly print the text associated with several stored procedures across multiple database servers to individual files. I used what is below. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30... »
Constructing a thread when you don’t know the class ahead of time
While building a generic load testing toolkit, I found it useful to be able to use a standard invocation framework for running a thread class that contains the actual application code to be stress tested. However, I had some problems determining how to dynamically create a set of threads when I didn’t know the... »
Multiple threads using same physical connection
This just doesn’t sound good. Having multiple threads use the same physical connection sounds like an exercise in frustration. Although the OracleDataSource connection object is thread safe, there is really no need to create a smaller number of connections than threads and then use them as static class variables. We had this issue last... »
Yet another reason to use Oracle’s JDBC connection manager
Over the weekend we had an odd issue. We have four nodes in a cluster, with two core services. SERVICE_A runs on servers 1 and 2, while SERVICE_B runs on server 4. Server 3 is effectively idle most of the time unless we need to allow for additional throughput. Server 3 died on Friday... »
JDBC connection timeout
While testing a remote data center today, we had some network connectivity issues. We twiddled our thumbs while waiting for connections to throw an exception due to a network block. I found the setLoginTimeout() method on the DriverManager class. You can use it as show below: 1 2 3 4 5 6 7 8... »
Do we actually use characters that require more than one byte?
I couldn’t find a way to identify those columns that actually had a character with a code point value greater than 255. As a result, I ended up writing the following. If you have better way, please reply. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16... »
Who’s blocking my java?
Hanging java applications can be a system architects worst nightmare. There are so many pieces in the stack, finding where the true issue lies can be a daunting task. Fortunately, you can dump all threads in a JVM to see where it may be hanging. DBA’s specifically should be able to read a thread... »
Java Lock class is great for test casing
OK, so while trying to understand Oracle’s redo latching mechanisms (we have been experiencing a nightmare with log file sync since switching to a new DMX subsystem), I found that java 1.5 has a new Lock class. How cool is that?!!! 1 2 3 4 5 6 7 8 9 10 11 12 13... »
Statistical functions with java
Below is a simple set of classes for performing your own statistical analysis. As noted, they are simple (no multiple regression analysis, etc.) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31... »
Getting connection strings from LDAP
After a recent migration, we found deficiencies with the process of how clients connect. As such, we are trying to standardize our repository of connection strings. We implemented an OpenLDAP server and added the schema information for Oracle objects from OID (Oracle Internet Directory). We were able to access the strings, but found ourselves... »