websphere

Websphere Wierdness

I discovered a joyful thing with the websphere JDBC connection:

You want to make a prepared statement that uses the “like” operator.

You write :

select * from SOMETABLE where SOMECOLUMN like ?

and it throws an IndexOutOfBoundsException !!

YOU HAVE TO GET THE CASE CORRECT! so :

select * from SOMETABLE where SOMECOLUMN LIKE ?

or

select * from SOMETABLE where SOMECOLUMN Like ?

Weird eh ?

also if you want to select by a date you have to do :

select * from SOMETABLE where SOMEDATECOLUMN = to_date(?, ‘dd-mm-yyyy’)

putting in whatever format you have.

Share

databases
oracle
sql
websphere

Comments Off

Permalink

Util Logging

ok so now i need to know about java logging with the util package…

pretty simple ….

private static Logger log = Logger.getLogger(XSDStoreServletParameters.class.getName());

then log.finest(“hello”);

and

if (log.isLoggable(Level.CONFIG)) {

}

etc.

problem is that it doesnt do anything in the websphere process server…

hey ho.

it uses the old commons-logging (apparently called “JCL” these days!)

grrrrrr!

so you do :

private static Log log = LogFactory.getLog(JDBCToXML.class);

then its just like Log4J

the trick is to get Websfear to print it out – it doesnt want to put low level logging to the console.

you can get it to go to a file though and tail that i guess.

Share

jdk
logging
websphere

Comments Off

Permalink