Board index » jbuilder » How to register the MSSQL JDBC drivers

How to register the MSSQL JDBC drivers


2005-01-27 10:21:57 PM
jbuilder10
I am a Java newbie trying to add the MS SQL .jar files to my Jbuilder 2005 environment as a library called MSSGL. I have gotten as far as having the library show up as a drive connection choice when making a database connection, but it is listed in red, which I understand means that the driver has not been registered. I can connect to my db using ODBC, but we wish to use the other drivers. Can anyone point me in a helpful direction to getting this library operational? There is a MSSQL.config file in .../lib/lib-ext which points to the correct .jar files. What else do I need to do?
 
 

Re:How to register the MSSQL JDBC drivers

"Davek" < XXXX@XXXXX.COM >wrote in message
Quote

Create the Library. Tools/Configure Libraries. Click on the newly created
Library name (the name you named the MSSQL Drivers.
Go to the Class Tab. Make sure all of the jar files needed are added.
Try running the code again. If you get some dependency failure, some needed
jar file is not in the library. If it shows up in red, then the jar file is
not on yuour classpath or was not saved in the required classes tab.
 

Re:How to register the MSSQL JDBC drivers

"Paul Nichols \(TeamB\)" < XXXX@XXXXX.COM >wrote:
Quote

"Davek" < XXXX@XXXXX.COM >wrote in message
news:41f8f905$ XXXX@XXXXX.COM ...
>
Create the Library. Tools/Configure Libraries. Click on the newly created
Library name (the name you named the MSSQL Drivers.

Go to the Class Tab. Make sure all of the jar files needed are added.

Try running the code again. If you get some dependency failure, some needed
jar file is not in the library. If it shows up in red, then the jar file is
not on yuour classpath or was not saved in the required classes tab.


I tried that and no luck. I am using the Database Pilot as a test of getting this correct. I can connect with DB Pilot if I specify the driver url as com.microsoft.jdbc.sqlserver.SQLServerDriver, but I have not been able to get my MSSQL library entry out of the red. There were no dependency failures.
The .jar files (there are 3), do show up in the classpath when I run the app. I also used the Enterpise Setup Database Drivers window to add an item called MSSQL.config. This config file has 3 lines, each pointing to one of the jar files. Is the order of the lines in this file important? It does not seem to be.
During testing, I can make a connection with the url, but why does this not stay when I restart Jbuilder and go to the UI designer? I have to re-enter the connection info each time and re-run the QueryDataSet as well. I would have thought that if I saved the changes, these settings would persist. Or is that an IDE question?
 

{smallsort}

Re:How to register the MSSQL JDBC drivers

"DaveK" < XXXX@XXXXX.COM >wrote in message
Quote

"Paul Nichols \(TeamB\)" < XXXX@XXXXX.COM >wrote:
>
>"Davek" < XXXX@XXXXX.COM >wrote in message
>news:41f8f905$ XXXX@XXXXX.COM ...
>>
>Create the Library. Tools/Configure Libraries. Click on the newly created
>Library name (the name you named the MSSQL Drivers.
>
>Go to the Class Tab. Make sure all of the jar files needed are added.
>
>Try running the code again. If you get some dependency failure, some
needed
>jar file is not in the library. If it shows up in red, then the jar file
is
>not on yuour classpath or was not saved in the required classes tab.
>
>
During testing, I can make a connection with the url, but why does this
not stay when I restart Jbuilder and go to the UI designer? I have to
re-enter the connection info each time and re-run the QueryDataSet as well.
I would have thought that if I saved the changes, these settings would
persist. Or is that an IDE question?
Ahh, different scenario. Add to the jbuilder/bin/dbpilot.config file a line
at the bottom like
addpath ../lib/ext/mssql.jar
addpath ../lib/ext/mssql2.jar
addpath ../lib/ext/mssql3.jar
where the mssql.jar are the actual file names of the jar files and the path
points to where you have these jar files. That should take care of the
issue.
 

Re:How to register the MSSQL JDBC drivers

"Paul Nichols \(TeamB\)" < XXXX@XXXXX.COM >wrote:
Quote

"DaveK" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...
>
>"Paul Nichols \(TeamB\)" < XXXX@XXXXX.COM >wrote:
>>
>>"Davek" < XXXX@XXXXX.COM >wrote in message
>>news:41f8f905$ XXXX@XXXXX.COM ...
>>>
>>Create the Library. Tools/Configure Libraries. Click on the newly created
>>Library name (the name you named the MSSQL Drivers.
>>
>>Go to the Class Tab. Make sure all of the jar files needed are added.
>>
>>Try running the code again. If you get some dependency failure, some
needed
>>jar file is not in the library. If it shows up in red, then the jar file
is
>>not on yuour classpath or was not saved in the required classes tab.
>>
>>
>During testing, I can make a connection with the url, but why does this
not stay when I restart Jbuilder and go to the UI designer? I have to
re-enter the connection info each time and re-run the QueryDataSet as well.
I would have thought that if I saved the changes, these settings would
persist. Or is that an IDE question?

Ahh, different scenario. Add to the jbuilder/bin/dbpilot.config file a line
at the bottom like

addpath ../lib/ext/mssql.jar
addpath ../lib/ext/mssql2.jar
addpath ../lib/ext/mssql3.jar

where the mssql.jar are the actual file names of the jar files and the path
points to where you have these jar files. That should take care of the
issue.


Tried that as well and restarted Jbuilder. No change. My library entry MSSQL is still red. If I understand this correctly, with a good library entry (black), I would not need to use the com.microsoft.... construct in the database connection object?
 

Re:How to register the MSSQL JDBC drivers

DaveK wrote:
Quote

Tried that as well and restarted Jbuilder. No change. My library
entry MSSQL is still red. If I understand this correctly, with a
good library entry (black), I would not need to use the
com.microsoft.... construct in the database connection object?

Please describe the location of your library file for the MSSQL jars.
If you have a red library entry, that means JBuilder cannot find the
library. Did you move the library, or rename it?
Also, if you properly created a library, and added the library to the
database configurations under Enterprise Setup, you should not have to
perform those addpath commands, because DBPilot should be able to read
the configuration file.
You will ALWAYS have to use the "com.microsoft..." construct to create
your database connection. That loads and registers the driver and is
required. You should read the JDBC tutorial if you are confused on this
point.
java.sun.com/developer/onlineTraining/Database/JDBC20Intro/
--
Regards,
Lori Olson [TeamB]
------------
Save yourself, and everyone else, some time and search the
newsgroups and the FAQ-O-Matic before posting your next
question.
Google Advanced Newsgroup Search
www.google.ca/advanced_group_search
Other Newsgroup Searches:
www.borland.com/newsgroups/ngsearch.html
Joi Ellis's FAQ-O-Matic:
www.visi.com/~gyles19/fom-serve/cache/1.html
 

Re:How to register the MSSQL JDBC drivers

"Lori M Olson [TeamB]" < XXXX@XXXXX.COM >wrote:
Quote
DaveK wrote:

>
>Tried that as well and restarted Jbuilder. No change. My library
>entry MSSQL is still red. If I understand this correctly, with a
>good library entry (black), I would not need to use the
>com.microsoft.... construct in the database connection object?
>

Please describe the location of your library file for the MSSQL jars.
If you have a red library entry, that means JBuilder cannot find the
library. Did you move the library, or rename it?

Also, if you properly created a library, and added the library to the
database configurations under Enterprise Setup, you should not have to
perform those addpath commands, because DBPilot should be able to read
the configuration file.

You will ALWAYS have to use the "com.microsoft..." construct to create
your database connection. That loads and registers the driver and is
required. You should read the JDBC tutorial if you are confused on this
point.

java.sun.com/developer/onlineTraining/Database/JDBC20Intro/
My 3 jar files are in the following directory - C:\j2sdk1.4.2_05\lib-ext\lib. There is a line for each in the Class tab of the Configure Libraries window. The library name, MSSQL, is under the User Home folder on the same window. There is a MSSQL.configure file with the same entries in C:\Borland\Jbuilder2005\ext directory. What more do I need?
I will take a look at the tutorial, but I was also working my way through the Borland database tutorial as well.
 

Re:How to register the MSSQL JDBC drivers

"DaveK" < XXXX@XXXXX.COM >wrote in message
Quote

"Lori M Olson [TeamB]" < XXXX@XXXXX.COM >wrote:
>DaveK wrote:
>
>>
>>Tried that as well and restarted Jbuilder. No change. My library
>>entry MSSQL is still red. If I understand this correctly, with a
>>good library entry (black), I would not need to use the
>>com.microsoft.... construct in the database connection object?
>>
>
Dave,
Make sure that you modify the dbpilot.config file in the /jbuilder/bin
folder. You should have an addpath=/j2sdk/lib/ext/<jarfilename>for each jar
file, if you want to use the Visual Database editor or the DBPilot tools.