• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic