NetBeans 6.5 includes JDBC drivers for Postgresql and Mysql, two most popular opensource databases. Database integration in NetBeans is done is such way that it is possible to create database connection and use it in built-in SQL client or JPA modelling/programming.
In order to use databases more common in enterprise world, we need to add a JDBC driver to NetBeans.
In this example we will add and configure Sybase database connection.
We’ll use official Sybase driver, available from
http://www.sybase.com/products/allproductsa-z/softwaredeveloperkit/jconnect
Step 1. Open Services view and navigate to Databases -> Drivers
Step 2. Right click on Drivers and select “New Driver…”
Step 3. We will get dialog with information about new JDBC driver.
Step 4. In the upper part of dialog, we’ll choose a .jar file that contains Sybase JDBC driver, in this case it’s name is jconn3.jar. After choosing .jar files, we need to press ‘Find’ button to list all classes that implement java.sql.Driver and we’ll choose com.sybase.jdbc3.jdbc.SybDriver. We’ll also give a name to the driver configuration.
Step 5. Now we have a new driver installed. In order to use the driver, we need to create a database connection. Do the right click on new driver’s name and choose ‘Connect Using…’:
Step 6. In this step we’ll provide database username and password. We can choose to save password. NetBeans help has more information about security of such action.

Step 7. We need to provide JDBC url. It is vendor and driver specific – on the image bellow I used Sybase URL format:
Step 8. We also need to choose a schema that we’re connecting to.
We’re done! New Sybase connection is ready. It can be used in JPA applications or in built-in SQL client.







8 responses so far ↓
Helped // January 28, 2009 at 4:12 pm |
Very Helpful. Many thanks
Vihanga // February 17, 2009 at 6:07 am |
Difficult to understand …..
newsintegrator // February 19, 2009 at 1:47 pm |
I am sorry you find it difficult. What would you improve?
moises // February 26, 2009 at 11:18 am |
do you know if it works with jdk 1.6
newsintegrator // February 26, 2009 at 10:50 pm |
It should. Do you refer to Sybase driver or NetBeans?
JCARLO // March 24, 2009 at 6:27 pm |
You can use
com.sybase.jdbc.SybDriver in Driver Class
newsintegrator // April 25, 2009 at 9:10 pm |
Hi,
I remember that there was a reason to use com.sybase.jdbc3 package – was it related with XA transactions or something else, I don’t know exactly. I worked with Sybase only in J2EE/JEE context and it worked for me. I will try to find exact reason and post it here.
Shashi // June 16, 2009 at 5:34 pm |
Difficult to understand the schema part. When Database is already given using the URL, why do we have to select the schema?