当前位置: 技术问答>java相关
请教jbuilder5与jdbc高手 (20分)!!!!!!!!!!!!!!!!!!!!!
来源: 互联网 发布时间:2015-02-11
本文导语: 如何将下载的postgresql 7 注册成jbuilder5的driver并建立远程连接? | postgresql 7 注册成jbuilder5的driver并建立远程连接? 我想应该是和*** JBuilder 5 中如何设置8 JDBC **********差不多吧 JBuilder, T...
如何将下载的postgresql 7 注册成jbuilder5的driver并建立远程连接?
|
postgresql 7 注册成jbuilder5的driver并建立远程连接?
我想应该是和*** JBuilder 5 中如何设置8 JDBC **********差不多吧
JBuilder, The JDBC Explorer And Database Drivers
In order for the JDBC Explorer and your own applications to use a JDBC
driver that JDBC driver must be on your classpath. An application's classpath,
when you launch that application from JBuilder, is determined by the application's
Project Properties. The JDBC Explorer's classpath is not determined by Project Properties.
It is determined when you start up JBuilder, or when you start up the JDBC Explorer in
stand-alone mode. This means that in order to use your database driver in these different
situations, you will have to have your classpath setup correctly for each case.
You will also find an explanation of how the drop-down database driver list works
in the various parts of JBuilder at the end of this document.
For this document, let's say we have the following Oracle driver that we wish to use:
c:/orant/jdbc/lib/classes12_01.zip
Making A Driver Available To The JDBC Explorer
JBuilder 4
Select Tools | Enterprise Setup.
Click on the Database Drivers tab.
Click on the Add button.
If you have a Library already defined that references the above zip file, goto step 10.
If you do not have such a Library defined, click on the New button.
Enter a name for the Library, e.g., "Oracle".
Click on the add button.
Navigate to and select c:/orant/jdbc/lib/classes12_01.zip
Click OK.
Select the Library that references the Oracle .zip file (it will be named "Oracle" if
you just created it in step 6).
Depending on the name of your Library, you will now see a .config file in the listbox,
e.g., "Oracle.config".
Select OK.
You now need to restart JBuilder for your changes to take affect. If you run the JDBC Explorer stand-alone, the Oracle driver will also be on the JDBC Explorer's classpath.
The next time you run JBuilder or the JDBC Explorer, the driver will be available on the classpath.
Making A Driver Available To Your Application
With your application's Project open, select Project | Properties.
Click on the Required Libraries tab.
Click on the Add button.
If you have a library defined for your driver select it and click OK.
Otherwise, click on New, and define a library pointing to your driver.
Then select the new library and add it to your project's required libraries.
Fat Drivers
JDBC Type 2 drivers, also known as "fat" drivers, are drivers that call into local
binaries that in turn communicate with the database. Some fat drivers include the Oracle
OCI driver and IBM's DB2 driver (note that the Oracle thin driver, as its name implies,
is not a fat driver). The JDBC driver needs to be able to find those local binaries in
order to function properly. If you have the Java .jar/.zip file correctly set up on your
classpath for fat driver, and the driver still does not appear to load correctly, there
are a couple of things you can try:
Add the client's binary directory to your operating system's PATH.
Or, specify the location of the binary directory via the system property java.library.path
For the JDBC Explorer
JBuilder 4 and JBuilder 3.5:
Add this line to the "jdk.config", located in your "jbuilder35/bin" or "/jbuilder4/bin"
directory:
vmparam -Djava.library.path=c:/orant/bin
If you already have a "java.library.path" entry, simply append your path to the end of
that entry, separating this new entry from the rest of the line either with a colon
(Linux/Solaris), or a semi-colon (Windows).
For your application
Project | Properties
Click on the Run tab
Append this to the VM Parameters entry: -Djava.library.path=c:/orant/bin
Drop Down List Of Drivers
In the JDBC Explorer, when you do File | New, a combobox with a list of drivers appears.
This combobox also appears in other contexts in JBuilder, e.g., in the ConnectionDescriptor
property editor. This list of drivers is simply a facility to make it easier to select a driver.
It is not an exhaustive list of drivers, nor does the presence of a driver on that list
necessarily mean that the driver is on the classpath. It also possible that a driver is on
your classpath, but not in the dropdown list. If a driver on the classpath is not in the list,
you can still use that driver: simply type in the driver's classname.
In JBuilder 4, you can tell which drivers in the dropdown list are actually on the classpath.
Drivers on the classpath will be in black, while drivers not on the classpath will be in red.
In versions before JBuilder 4, it is not visually possible to determine which of those drivers
are on the classpath.
If you wish, you can add new drivers to the dropdown list, and/or remove drivers that you know
you will never use:
JBuilder 4
Run the JDBC Explorer
View | Options
Select the Drivers tab.
Using the UI, you can add, edit, and remove drivers.
我想应该是和*** JBuilder 5 中如何设置8 JDBC **********差不多吧
JBuilder, The JDBC Explorer And Database Drivers
In order for the JDBC Explorer and your own applications to use a JDBC
driver that JDBC driver must be on your classpath. An application's classpath,
when you launch that application from JBuilder, is determined by the application's
Project Properties. The JDBC Explorer's classpath is not determined by Project Properties.
It is determined when you start up JBuilder, or when you start up the JDBC Explorer in
stand-alone mode. This means that in order to use your database driver in these different
situations, you will have to have your classpath setup correctly for each case.
You will also find an explanation of how the drop-down database driver list works
in the various parts of JBuilder at the end of this document.
For this document, let's say we have the following Oracle driver that we wish to use:
c:/orant/jdbc/lib/classes12_01.zip
Making A Driver Available To The JDBC Explorer
JBuilder 4
Select Tools | Enterprise Setup.
Click on the Database Drivers tab.
Click on the Add button.
If you have a Library already defined that references the above zip file, goto step 10.
If you do not have such a Library defined, click on the New button.
Enter a name for the Library, e.g., "Oracle".
Click on the add button.
Navigate to and select c:/orant/jdbc/lib/classes12_01.zip
Click OK.
Select the Library that references the Oracle .zip file (it will be named "Oracle" if
you just created it in step 6).
Depending on the name of your Library, you will now see a .config file in the listbox,
e.g., "Oracle.config".
Select OK.
You now need to restart JBuilder for your changes to take affect. If you run the JDBC Explorer stand-alone, the Oracle driver will also be on the JDBC Explorer's classpath.
The next time you run JBuilder or the JDBC Explorer, the driver will be available on the classpath.
Making A Driver Available To Your Application
With your application's Project open, select Project | Properties.
Click on the Required Libraries tab.
Click on the Add button.
If you have a library defined for your driver select it and click OK.
Otherwise, click on New, and define a library pointing to your driver.
Then select the new library and add it to your project's required libraries.
Fat Drivers
JDBC Type 2 drivers, also known as "fat" drivers, are drivers that call into local
binaries that in turn communicate with the database. Some fat drivers include the Oracle
OCI driver and IBM's DB2 driver (note that the Oracle thin driver, as its name implies,
is not a fat driver). The JDBC driver needs to be able to find those local binaries in
order to function properly. If you have the Java .jar/.zip file correctly set up on your
classpath for fat driver, and the driver still does not appear to load correctly, there
are a couple of things you can try:
Add the client's binary directory to your operating system's PATH.
Or, specify the location of the binary directory via the system property java.library.path
For the JDBC Explorer
JBuilder 4 and JBuilder 3.5:
Add this line to the "jdk.config", located in your "jbuilder35/bin" or "/jbuilder4/bin"
directory:
vmparam -Djava.library.path=c:/orant/bin
If you already have a "java.library.path" entry, simply append your path to the end of
that entry, separating this new entry from the rest of the line either with a colon
(Linux/Solaris), or a semi-colon (Windows).
For your application
Project | Properties
Click on the Run tab
Append this to the VM Parameters entry: -Djava.library.path=c:/orant/bin
Drop Down List Of Drivers
In the JDBC Explorer, when you do File | New, a combobox with a list of drivers appears.
This combobox also appears in other contexts in JBuilder, e.g., in the ConnectionDescriptor
property editor. This list of drivers is simply a facility to make it easier to select a driver.
It is not an exhaustive list of drivers, nor does the presence of a driver on that list
necessarily mean that the driver is on the classpath. It also possible that a driver is on
your classpath, but not in the dropdown list. If a driver on the classpath is not in the list,
you can still use that driver: simply type in the driver's classname.
In JBuilder 4, you can tell which drivers in the dropdown list are actually on the classpath.
Drivers on the classpath will be in black, while drivers not on the classpath will be in red.
In versions before JBuilder 4, it is not visually possible to determine which of those drivers
are on the classpath.
If you wish, you can add new drivers to the dropdown list, and/or remove drivers that you know
you will never use:
JBuilder 4
Run the JDBC Explorer
View | Options
Select the Drivers tab.
Using the UI, you can add, edit, and remove drivers.
|
To:intll(卤蛋)
最好检查postgresql 7 的JDBC驱动包是否正确,
我用过Oracle8.1.7的Thin drivers,一切很正常,而且连接Oracle8.0.5也照样使用。
最好检查postgresql 7 的JDBC驱动包是否正确,
我用过Oracle8.1.7的Thin drivers,一切很正常,而且连接Oracle8.0.5也照样使用。