• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate + Spring + Oracle: Help, can't get connection working

 
laura mccord
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having problems troubleshooting my hibernate connection.

I can telnet to the remote server and port so it doesn't look like a firewall issue.

Frankly, I am only experienced with creating a new database with hibernate and in this case I am trying to connect to an existing read-only database.

I am receiving the following error and I'm not sure where to start debugging:




My first reaction was that perhaps my mapping is not correct and the data types do not match. It's an Oracle database and all of the table fields are varchar2() so I am using 'string' as the type. Or, maybe my mapping to column names and the table name is not working. Below is my mapping:



Here is also my hibernate.cfg.xml file:



Finally, this is my implementation of querying the table


Thanks for any help you can offer.
 
Jayesh A Lalwani
Rancher
Posts: 2756
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably the problem is that the validation query in your data source is not valid. Look at how the data source is defined
 
laura mccord
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My datasource.properties file looks like this:



Then my applicationContext.xml looks like the following:




Can't think of anything that I am missing, but I'm still receiving the same error:

ERROR [uPortal-PortletExecutor-1-RENDER-[ucm-checklist-portlet]] portlet.DispatcherPortlet.[] Jan/09 10:47:24 - Could not complete request
org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: Cannot open connection; uncategorized SQLException for SQL [???]; SQL state [null]; error code [0]; Cannot create PoolableConnectionFactory (Invalid SQL type); nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Invalid SQL type)


Thanks

 
laura mccord
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I confirm that a connection was made successfully before trying a select query?

This is what I did and I suppose it's working since I'm receiving the message that it's open?




Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic