Category: Development

Simple example of C# program accessing Oracle

Nothing big, just a placeholder for an example of what is in the subject line. //C:\Users\showard>C:\Windows\Microsoft.NET\Framework\v2.0.50727\csc.exe /r:”C:\oracle\product\11.2.0\client_1\ODP.NET\bin\2.x\Oracle.DataAccess.dll” checkConn.cs using System; using Oracle.DataAccess.Client; public class checkConn { public static void Main(String []args){ OracleConnection conn = new OracleConnection(“User Id=biztalk;Password=********;Data Source=fn9dev”); OracleDataReader rdr;…

Print thread dump for a single thread

We had an issue where a single thread was using all the CPU. We wanted to check it at the command line while troubleshooting. We used what is below… [atg@CMHLDECOMAP01 ~]$ jstack 3000 | awk ‘{if ($1 == “\”Thread-9\””) {i…

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. import java.sql.*; import com.microsoft.sqlserver.jdbc.*; import java.io.*; public class sqlProcedures { public static void main(String[] args) {…

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…