Kev Miller

Greenhorn
+ Follow
since Jul 16, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Kev Miller

Hi,

I'd like to use Hibernate to abstract from different databases that I am using. I have to run plain sql statements against different (vendor) databases WITHOUT mapping the result to objects that I would first have to create. I am only interested in the generic jdbc/database abstraction feature since my system requires updates to the list of registered sql queries quite frequently.

I have used hibernate (native queries) for this which works fine.
However I need to determine the type of the row elements coming back and had to find out that the hibernate method that would do this (getReturnTypes() in SQLQuery) has not been implemented yet and only throws

Exception in thread "main" java.lang.UnsupportedOperationException: not yet implemented for SQL queries
at org.hibernate.impl.SQLQueryImpl.getReturnTypes(SQL QueryImpl.java:226)

Is there any workaround to this problem? I had to look into hibernate because I have oracle specific code in one of my classes that is using jdbc. The number of different sql statements that this class is running is very high and I can't create Java Beans for them since a new sql statement might be added at runtime.

Also I need a way to query for the column names of the result set coming back.

Is there any way in hibernate or a different jdbc abstraction framework (vendor neutral) that would allow me to query for data types and column names in a result set?

Cheers,
Kevin
Hi,
on page 227 (Head First EJB) it says that ejbCreate is invoked by the container without a client request. On the following page, however, it says that you can get a reference to your EJBObject from within ejbCreate. How can you get such a reference when the container invokes ejbCreate without any client request? Isn't an EJBObject instance only created when the client invokes create on his home object stub (whereas the EJBObject instance is not linked to an actual bean instance until a business method call)?
Thanks,
Kev