Wednesday, April 28, 2010

Firefox bookmarks

If you want to use a new browser and use your existing bookmarks from your older browser, say, firefox, all you have to do is Bookmarks -> Organize Bookmarks -> Import and Backup -> Export HTML. Save the bookmarks.html on your desktop and import them into your new browser. Done !!

Wednesday, April 14, 2010

Timeouts when launching tomcat in eclipse

Sometimes, when launching tomcat in eclipse over a slow internet connection, you might face a timeout, especially if tomcat is trying to establish connections to database servers. In such cases, you can increase the timeout value as follows:
* Right click on the 'Tomcat Server' in your 'Servers' tab in the 'Fast View'
* Click on 'Open'
* Expand the 'Timeouts' tab and specify a higher value for 'Start'

Spring - Context Initialization failed

Sometimes when trying to launch a spring app on your webserver, it might not launch due to a context initialization failure. An obvious reason for this failure is that the applicationContext cannot be found or the DB login credentials are incorrect. However, this wasn't the problem in my case. It finally struck me that the app might be expecting the jdbc password to be encrypted (base64 in my case) and not in plain text. Once I substituted the base64 version of my password in the properties file, I was able to launch the app successfully.

Friday, October 30, 2009

Escaping & in SQL

SQL *PLUS treats the '&' in queries as a substitution variable by default.
If you are using SQL Developer, you might get an unexpected resposne if you have '&' in your query.
It prompts you for a value for the string that follows. For example if you have a query like

Select * from emp where name = 'Carrol & Scott',

you will get a pop up a message like 'enter value for scott' or something like that.

In such cases, turn off substitution by using 'SET DEFINE OFF' or you can tell SQL *PLUS to use a different character for substitution like 'SET DEFINE $'

I didn't have this problem with SQL Navigator or JDBC. So, it's not a problem with Oracle.

Friday, July 24, 2009

java.sql.SQLException: Unsupported feature

This week I hit a problem when my application tried to write a blob to a Database.
I use container managed persistence with Websphere. It turned out the ojdbc jar at the location pointed to by the websphere variable - "ORACLE_JDBC_DRIVER_PATH" - needed to be updated to ojdbc14 which you can pick up from the Oracle lib folder.

This is part of the exception stack trace:

java.sql.SQLException: Unsupported feature
at oracle.jdbc.dbaccess.DBError.throwSqlException
(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException
(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException
(DBError.java:269)
at oracle.jdbc.dbaccess.DBError.
throwUnsupportedFeatureSqlException(DBError.java:689)
at oracle.sql.BLOB.setBinaryStream(BLOB.java:1007)

Note: Make sure you pick up this jar from the Oracle library. Other versions of ojdbc14 might not solve this problem.

Thursday, July 16, 2009

ORA-00942: table or view does not exist

Apart from the obvious cause of this error (mistake in the sql query), this could also happen if the user account used to connect to the DB, doesn't have the necessary privileges to access the table or view in the query.

Friday, July 10, 2009

java.io.IOException: Start of root element expected.

I hit a problem when passing an InputStream object to a parser today.

java.io.IOException: Start of root element expected.



Cause: The InputSteam object had been read prior to passing it to the DomParse. Seems obvious now, but its easy to miss this if you happen to be passing data to be parsed from some other method. (especially if you want to verify the contents of the InputStream)