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 transaction? That is, I’d like to insert all the team_player
Tag: oracle
SQLDeveloper runs query but getting a “ORA-00979: Not a Group By expression” from hibernate
I have data that looks something like this: And a query that works fine in Oracle SQL Developer (It returns data averaged over 15 second periods): but when I plug it into my java code, I get an error: The actual query string I use in the Jave looks more like this: and the parameters are set by calling: Anyone
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 hasn’t been stored, it allows
How to connect in java as SYS to Oracle?
I receive this error: How to fix? (I need to be SYS). Thanks. Answer try this :
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 simplify this? Answer Have a look at Hibernate Envers The Envers
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 access a column value after processing the resultset. Hope this will
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 page: http://wiki.eclipse.org/Configuring_a_EclipseLink_JPA_Application_(ELUG) it does not show any
Oracle doesn’t remove cursors after closing result set
Note: we reuse single connection. Answer The init.ora parameter open_cursors defines the maximum of opened cursors a session can have at once. It has a default value of 50. If the application exceeds this number the error “ORA-01000: maximum open cursors exceeded” is raised. Therefore it’s mandatory to close the JDBC resources when they are not needed any longer, in
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’t find out if it’s an oracle exception, I have to