Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialLaxmikanta Nayak
185 PointsCan you please tell me what i have to do to connect to oracle database 11g . I tried but i cant able to make it run.
Can you please tell me what i have to do to connect to oracle database 11g . I tried but i cant able to make it run.
I did not found much resource for the same.
1 Answer
Chris Ramacciotti
Treehouse Guest TeacherIf you've tried something and it hasn't worked, please include the relevant code and configuration to help us answer your question. In your case, that would include build.gradle, hibernate.cfg.xml, any Hibernate session configuration code, as well as the exact error messages you're seeing. Check out the Markdown Cheatsheet (also linked below the answer text box) for tips on formatting your code here in the community.
In any case, I'll give you an overview of how to get started with Hibernate and Oracle.
First, you'll need the Oracle JDBC driver, which you can download from the Oracle website. You'll have to create a free Oracle account in order to do so.
After downloading the JAR, you can save it to to your project's root directory, and use your IDE to add it to the build path. You won't be able to use Gradle to pull it in for you without some extra configuration. There are a couple approaches you could consider, but I'll leave you to research that if you're interested.
After getting the Oracle JDBC drivers on your build path, be sure you're specifying all the appropriate values in your Hibernate configuration for connecting to the Oracle database, including url
, driver_class
, username
, and password
. If you're not running the DB server locally, check that the database is configured to accept remote connections for the user you're application uses.
Give it a shot, and if you're still running into problems, include your exact configuration and code using markdown for code formatting.