Thursday, February 09, 2012

Click and drag on a DOS prompt to pause the process

I always found this annoying, up until today. If you are running a process in a DOS box (like a server), clicking and dragging (to select text) will immediately pause the process. This caused trouble for me once years ago when I accidentally did this and couldn't work out why the server wasn't responding. Today I actually found a use for it.

I needed to debug an error in my Java web application that was happening during the application initialisation. Using Eclipse, I attach a remote debugger to the server, but the timing was hard, because the exception happens so quickly after I start the server. So, my solution: run the server from a DOS box and as quickly as I can after running the start command, click and drag on the DOS box.. then I can run the debugger and attach it before the exception occurs!

Oracle and Eclipse: SID vs Service Name

Saw this in Eclipse when trying to connect to an Oracle database using Data Source Explorer.

ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

Problem seems to be that when setting up my Oracle Thin driver properties, the SID really has to be a SID, when all I have is a Service Name. It means that the resulting DB URL is: jdbc:oracle:thin:@host:port:sid when it should be: jdbc:oracle:thin:@host:port/service-name.

The answer is to use a different option in Eclipse when setting up the driver. Window > Preferences > Data Management > Connectivity > Driver Definitions > choose "Other Driver" for Oracle instead of Oracle Thin Driver. This gives you the option of directly setting the Connection URL.