Skip to content

Tag: oracle

Getting id after insert within a transaction (Oracle)

Let’s say I have three tables: team, player, team_player. Table team_player is a bridge table allowing a “many to many” relationship. When someone wants to create a new team, they specify the initial players on that team. How do I insert both the team and team_player rows in the same transac…

how to store date AND time with JPA in Oracle?

I’m using WebSphere 7 (Java EE 5) and OpenJPA 1.2.1. I have a JPA object with a “modifiedTimestamp” attribute, something like this: The related field in the Oracle database is of type DATE. I set the date like so … … and it gets stored, but when I read it back the time of day has…

hibernate or oracle support for timelines?

We have a requirement for persisting, using Hibernate, versioned Java objects into an Oracle database such that each version has a valid-from and valid-until timestamp. This is so we can query for objects as-at a specific time. Does Hibernate or Oracle 11g (or anything else) provide anything that would simpli…

java.sql.SQLException: Exhausted Resultset

I get the error java.sql.SQLException: Exhausted ResultSet to run a query against an Oracle database. The connection is via a connection pool defined in Websphere. The code executed is as follows: I note that the resultset contains data (rs.next ()) Thanks Answer I’ve seen this error while trying to acc…

How to set application name with JPA (EclipseLink)?

hello everybody i am using JPA with EclipseLink and oracle as DB and i need to set the property v$session of jdbc4 it allows to set an identification name to the application for auditing purposes but i had no lucky setting it up….i have been trying through entitiyManager following the example in this pa…

Java – find the first cause of an exception

I need to check if an exception is caused by some database problem. I receive an Exception and check if its cause contains the “ORA” string and return that (something like “ORA-00001”). The problem here is that the exception I receive is nested inside other exceptions, so if I don&#821…