Create a new connection in the DB Browser of MyEclipse

Source: Internet
Author: User
Oracle-related drivers and Java JDK versions (although some are not absolute)

Ojdbc14.jar for jdk1.4 and later versions
jkd1.3 with Classes12.jar

My JDK is 1.5, the best use Ojdbc14.jar, although not absolute, with Classes12.jar also can use,
But with the hibernate3, it's best to use Ojdbc14.jar.
The high version of the driver is mostly newer than the lower version of the revision many new restrictions to adapt to the development and use of the time.

One of the netizens said:
---
It is important to note that when using the ORACLEJDBC driver, you must use the latest Oracle 10.2.0.0 driver, otherwise when you connect to the database, especially the lower version of the data, data binding errors occur when data is inserted into the VARCHAR2 when data is 500 characters. This problem is a JDBC error and is the same problem in Ibatis, Hibernate, and spring.

The package in the attachment is the latest JDBC driver in Oracle 10.2.0.1.0, without this problem.
---

So it is highly recommended that you use a high version of JDBC driver to accommodate the needs of some other applications, such as Hibernate, Spring, and so on.

My Oracle is 9i, but the Oracle 10.2.0.1.0 JDBC driver is still fine. Since Oracle's JDBC driver is backward compatible with 9i, whether it is compliant to Oracle8 or earlier, interested friends can try or go to Oracle's website to look up information.

First search from the Internet, download a Ojdbc14.jar package

"Detailed use steps"
1. Remove the previous Classes12.jar package, add as a new Ojdbc14.jar package (preferably two drivers are used, because they are the same JDBC name, he will find classpath on the front of the jar bag, so be sure to remove the old add near new. The specific setting is to select the project you developed in MyEclipse, right-click the properties, then select Java Builder Path in the pop-up dialog box, then select Libraries, and then show you all the class libraries and jar packs you want to use. If you have a clssses12.jar bag, remove it by clicking Remove. Then click the Add External Jar button to add the Ojdc14.jar package from the project's external selection path. then click OK.

2. Create a new connection in the DB Browser of MyEclipse. In driver name, still fill in the uniform oracle.jdbc.driver.OracleDriver. Only then it is best to select the Add Jars button in dirver jars and select the Ojdbc14.jar you downloaded. This is to tell DB browser which jar package you are using for the Oracle driver. Then fill in the connection URL, and then fill in user name, preferably fill in the blanks, should be found after filling in the user name, DB browser will default this user name to the schema value. If not, it does not matter, DB Browser connection will display the user's object, appears a lot very messy, not easy to find. and other users of the table if you do not give the current connection user authorization, then you can not see other users of the table, the display of so many user objects also useless.

3. Fill in the password, if you do not choose Save Password (save password), then do not fill in the line, anyway, did not choose the Save Password option, when the connection will be back to let you enter the password.

4. Select Next, and then let you select the schema to display. A typical user should choose the display default schema (only the current connected user), so it is convenient to view them later. If the DBA (database administrator) user is connected, you can select Disaplay all schema (you can view all users). To see more than one user, you can choose to Desplay the selected schema, by clicking the Add button to add the schema you want to select, connecting to the database (which may allow you to enter a password), and then querying all the schemas for you to choose from.

Finally click on the Finsh button, to the DB browser now a connection connection is set up.
But don't worry about using him to connect to the database first. Because first you have to perform the fifth step of the super IMPORTANT!!!!

5. Restart the!!! First Super important step. I just because did not restart first, so wasted a lot of time and brain cells, pain ~ ~ ~ Gone a lot of detours.
5.1 Close the MyEclipse development tool.
5.2 Oracleservice Service that closes the current database in the service
5.3 Then restart the Oracleservice service for the current database
5.4 Reopen no Eclipse development tools.

  6. Connect to the database using the newly equipped connection in DB browser.
    then view table
  7 Select Hibernate Reverse Engineering (Hibernate reverse engineering) on the selected table.
 
   This is what you're trying to build. Hbm.xml and Pojd and DAO, there should be no problem.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.