|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
||||
|
||||
|
Java & MySQL
I know I got to d/l a driver (and I hev it
)I downloaded it from www.mysql.com but I just kant figure it out how to install it.... I have to put a jar-file somewhere but I dont know why... ----------------------------------------------------------------------------------- can you compile java into a *.exe? (or executable file unter llinux) I use Borlands Jbuilder thx in advance |
|
#2
|
|||
|
|||
|
You have to put the .jar file into your classpath. Look at your help files, they'll tell you how to do that.
To execute a java program, you'd do something like: java myClass where myClass is a class file: "myClass.class". |
|
#3
|
||||
|
||||
|
Either copy the "com" and "org" subdirectories and all of their contents
to anywhere you like, and put the directory holding the "com" and "org" subdirectories in your classpath, or... Put mysql-connector-j-2.0.14-bin.jar in your classpath, either by adding the FULL path to it to your CLASSPATH enviornment variable, or putting it in $JAVA_HOME/jre/lib/ext. ----> but what is the class_path??? ----------------------------------- The class path is used during compiling. This path is constructed from all of the following: The output path The class path for each library listed on the Paths page of the Project Properties dialog box (in the same order in which they are listed) The target JDK version selected on the Paths page of the Project Properties dialog box The complete class path is composed of these elements in this order: output path + library class paths (in the order libraries are listed in the Project Properties dialog box) + target JDK version For example, the complete class path for Lion.class is: /<home>/<username>/jbproject/SampleProject/classes: /user/jbuilder/lib/dbswing3.1.jar:/user/jdk1.3/bin The class path is displayed on the Build tab after you compile. ------------------------------------ so this means that I have to install de driver seperatly for all applications? and the driver is compiled into the application itself? I am a complete Java n00b ![]() thanx in advance |
|
#4
|
||||
|
||||
|
Found The Solution
coppied the mysql-connector-java-2.0.14-bin.jar -file into jbuilders lib directory (youcan place it anywhere U like) In Jbuilder Tools> Enterprise Setup select Database Drivers Add... ->new... unter Library paths click add.. and select the mysql-connector-java-2.0.14-bin.jar and you're set (you can use the database pilot to test it) |
|
#5
|
|||
|
|||
|
Ya, the class path is used both during compilation and during execution.
Basically, it's a list of locations to look for extra classes, like an include path in php or header files in C. You can control the classpath each time you run the compiler or java executable, or you can set an environment variable with your own default classpath, or (like you found out) your ide has a few directories that are already in its own classpath. Oh, and classpaths can contain more than one directory, so you're not limited to putting all your classes in the same place. |
|
#6
|
||||
|
||||
|
but where can you find it .... is it held in a environment variable, ini,jar..... whatever...
|
|
#7
|
|||
|
|||
|
Often it's an environment variable, but it's also often passed to the java/javac executable as a command line parameter. To find what parameter is being passed, you'll have to look through the options/documentation for your IDE.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > Java & MySQL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|