Class.forName() lookup places for the driver

I'm trying to use java with mysql through mysql-connector-java all of them installed in Linux Debian Lenny, I've already read all the docs related to each of them, and they are workling except for one thing, It seems that jdk can't find the CLASSPATH value, so If I want to use the jar file of mysql-connector I have to do it like:
java -cp /connector myprogramSo, my question is: In linux OS, where - I mean in what file(s)- do jdk search the definition of CLASSPATH var?
At this time I've already set the CLASSPATH in .bashrc (from my HOME directory) and in /etc/profile and in both case jdk can't find it.
Regards

Yes you will always need to add your jar dependencies to your classpath. That's true of any jar files, not just database drivers.
Let's suppose your driver is named "mysql-connector-java-bin.jar"
When I worked in the command line mode on Linux, to compile programs I made use of the command line argument files ... described here...
http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/javac.html#commandlineargfile
Then when I wanted to run a program, I wrote a bash script that contained all the classpath information
-- begin script --
#!/bin/bash
# Run myprogram
java -cp {directory of jar file}/my-connector-java-bin.jar myprogram
-- end script --
then save the file as Runit.sh or something. Then in command line you can just call bash Runit.sh without typing out the full directory path of the database jar each time you run your application.
The value for {directory of jar file} must either be an absolute value from the root of the filesystem or relative to the current working directory. If it's relative to the current working directory use "./" as the prefix.
In general, it's best not to rely on system settings, like /etc/profile entries, for your classpath.

Similar Messages

  • IPhoto - My iPhoto is not responding. When I click on iPhoto I get a never ending spinning beachball.  I almost think it is looking in the wrong place for the pictures.  How do I redirect it back to the Mac hard drive?

    My iPhoto is not responding.  Whenever I click on the iPhoto icon I get a twirling beachball.  It is as if the machine is looking in the wrong place for the photos.  How can I see where the machine is looking to find out if this is really the problem.  How can I see the path?

    Try this:  launch iPhoto with the Option key held down and create a new, test library.  Import some photos and check to see if the same problem persists. If it doesn't then the problem lies with your current library.
    If that's the case  Apply the two fixes below in order as needed: 
    Fix #1
    Launch iPhoto with the Command+Option keys held down and rebuild the library.
    Since only one option can be run at a time start with Option #3, followed by #4 and then #1 as needed.
    Fix #2
    Using iPhoto Library Manager  to Rebuild Your iPhoto Library
    1 - download iPhoto Library Manager and launch.
    2 - click on the Add Library button, navigate to your Home/Pictures folder and select your iPhoto Library folder.
    3 - Now that the library is listed in the left hand pane of iPLM, click on your library and go to the File ➙ Rebuild Library menu option.
    4 - In the next  window name the new library and select the location you want it to be placed.
    5 - Click on the Create button.
    Note: This creates a new library based on the LIbraryData.xml file in the library and will recover Events, Albums, keywords, titles and comments.  However, books, calendars, cards and slideshows will be lost. The original library will be left untouched for further attempts at fixing the problem or in case the rebuilt library is not satisfactory.
    OT

  • I have a hard drive for CD storage that needs to connect to the Ethernet router. sInce my router is not in this room, and in another room, I want to use my Mac as a router for the drive, and share the wifi. Ho do I do this

    I have a hard drive for CD storage that needs to connect to the Ethernet router. sInce my router is not in this room, and in another room, I want to use my Mac as a router for the drive, and share the wifi. Ho do I do this? I gace tried the System Preferences -> Sharing, shared internet to Ethernet, but can't se ethe device on Finder

    Djembe wrote:
    UEFI (unified extensible firmware interface) boot requires Global unique identifier Partition Table (GPT) as opposed to the older Master Boot Record (MBR). If your existing drive is formatted in MBR, you will need to adjust BIOS settings to enable legacy boot in order for it to work properly.
    Is there a performance difference between GPT and MBR? If GPT is better, I do not mind formatting the drive with it.
    5. No special drivers are needed.
    Thanks. What about the thunderbolt port?
    7. I think Lenovo estimates 6 hours.
    Lenovo says 6 hours with the 6-cell battery on its website.
    BrendaEM wrote:
    Hi,
    There was a serious BIOS/UEFI problem with that SSD . Perhaps this thread will save you some headaches. Someone is recomending shutting off Rapid Boot in the setup, which would probable mean little with a SSD, anyway.
    I read through this, and it looks like the problem was fixed in a BIOS update, which I plan to do. However, it also seems like Intel Rapid Start is not even worth it in the first place, as sleep consumes almost no power at all.
    W540: i7-4700mq, K2100m, 8 GB DDR3L, 512 GB SSD
    T510: i7-620m, NVS 3100m, 8 GB DDR3, 512 GB SSD

  • Class not found exception for the startup class defined.

    iam using weblogic server 10 and bea jrockit 1.5.0.12.
    i have created a startup class in the admin console for a web project and i have deployed the war file using the console in a user defined domains, user project directory.
    when i start the server, iam getting class not found exception for the startup class.
    But, the startup class is available in the web archive (war). how should we add the classes and jars in the war to the classpath in setDomainEnv.sh or is there any other setting available in the console to enable this.

    Hello Julius,
    yes sure, we can move this post to the NW admin forum. I have already posted similar thread on sun forums. I was hoping that someone from SAP SDN already tackled this problem and if not someone specialized in J2EE Engine could troubleshoot me from the class problem I'm getting. I don't know if it's specific from the agent or if this ClassNotFound is a general SAP J2EE Engine error relating to a library not correclty defined.
    Kind regards,
    Tanguy Mezzano

  • What file name is for the driver of gpib-usb-b?and how to add the driver file to vb in win2000??thanks

    what file name is for the driver of gpib-usb-b?and how to add the driver file to vb in win2000??thanks

    Hi,
    Multiple files are required for the proer fnctioning of any of our GPIB products. Unfortunatly the installation is not as simple as copying a single file over. If you wish to make the installer silent, i believe this is entirely possible in a fashion similar to the details given at http://digital.ni.com/public.nsf/websearch/0730A66245E6808086256CA8006E2183?OpenDocument.
    Hope this helps out!
    Best Regards,
    Aaron K.
    Application Engineer
    National Instruments

  • "Preview for Files Not Available" & "Failed to Find a Place for the Imported File"??

    When I export RAW images into LR, some say "Preview for Files Not Available".  Also, it says "Failed to Find a Place for the Imported File".  Why?  What can I do to resolve this

    Hi,
    Tried with this but still the same issue..
    Stop the application services, recompile the JSP files manually, and start the application services. Check the login page then.
    Note: 435550.1 - R12 Login issue on target after cloning , fresh install or upgrade
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=435550.1
    Any other area to look into?
    Thanks for your time!
    Regards,

  • Need new firmware for the drive (Mat****a UJDA750)

    I have a Satellite M30 with a Mat****a UJDA750 combo drive. Does anyone know where I could get a new firmware for the drive?
    Thx.

    Hi,
    It would be up to Toshiba to release an official firmware update for this drive and at the moment they do not have one.
    You could of course look at 3rd party sites such as cdfreaks.com.
    Regards,
    Nick

  • Disk Utility "waiting for the drive"

    I'll be calling Applecare on this, but would like to know if anyone else has experienced this problem:
    I have a 2 month old MBP with the following model Super Drive:
    HL-DT-ST DVDRW GSA-S10N (according to System Profiler, it can write to all formats including -R, +R, DL). From another thread, I assume this is an LG?
    I decided to test the drive - made a short 40 second movie and created a disk image. Upon opening Disk Utility and inserting a DVD (Verbatim +R), I got the following: "waiting for the drive" for 5 minutes. Ejected the disk and tried again - same result.
    On the third try, it actually recognized the DVD, but only gave me the option to burn at 4x or 8x. I usually burn at the slowest speed available (2x), so I cancelled, ejected the disk and tried again. Fourth and fifth tries: no action, just "waiting for the drive".
    I then tried to use Toast with the Super Drive; before inserting the disk, I set Toast to burn at 2x, but once I inserted the disk, Toast recognized it, but changed the available burn options to 4x or 8x.
    Next I connected my external burner and got the options to burn at 2.4x, 4x, or 8x both in Disk Utility and Toast.
    I then used the same disk on my iMac; tried both the Super Drive and my external burner (using both Disk Utility and Toast with both) and got the following burn options:
    iMac Super Drive/Disk Utility: 2.4x, 4x, 8x
    iMac/external burner/Toast: 2x, 4x, 6x, 8x
    There seem to be a couple of issues:
    The "waiting for the drive" problem (what could possibly cause this?)
    The "non-availability" of a slow burn speed of the Super Drive
    And a third problem: this DVD drive is the slowest I've ever experienced; it took 50 seconds for the icon to appear on the desktop after inserting the DVD vs. 7 seconds on the iMac (this is the DVD I burned using Toast/exterbal burner,testing it on a TV and the iMac). It played fine on all three.
    Has anyone encountered a similar "waiting for the drive" issue and/or the fact that this drive takes a very long time to recognize/read a DVD?
    Appreciate any input!

    I spoke with a product specialist at Apple and it was agreed that we'd wait to see if the problem persisted; at that time, we'd talk about getting the drive replaced.

  • Burning a dvd ... "waiting for the drive" ??

    after choosing the file i want burn, i hit the "burn" button and a drop down window tells me that it's "waiting for the drive"... i've never seen this before. what gives?

    No offence, but did you remember to insert a blank CD or DVD?

  • Faxing does not work. Says it's waiting for the driver to connect.

    I set up the bluetooth fax printer but when I click to send the fax, it says that it's waiting for the driver to connect.
    Any ideas?

    If you don't have a land line you can't fax without a system like eFax which uses e-mail to send faxes to a phone number. If you have a land line, you must tie up the land line to connect to another phone number to Fax to it.
    You can probably also fax over VOIP based lines, but not all have a strong enough signal for faxing. Check with your VOIP carrier if you have one if Faxes are supported. Regardless, the Fax capability of any multifunction printer or scanner is only operable through an actual phone line. VOIP offers phone line to internet capability.

  • How do I submit a claim on the Class Action Apple settled for the iPhone with the water damage indicator red

    I stood in line the first day the original iPhone came out to purchase one.  The next day I purchased my second iPhone for my daughter and before long we had 4 iPhones in the house.  We still to this day have 4 iPhones.  Over the years several of my iPhones stopped working, I had paid extra to have the support contract on them only to find the local Apple store could care less.  They condemed my iPhones as being water damaged even though I was told the phones did not get dunked in water. 
    Today I learned Apple settled a Class Action in regards to the iPhones with warrenty where the liquid sensor was red and Apple refused to fix the problem.  In researching this I discovered reading the judges order in the case that Apple is supposed to have a 1-800 number setup and a website setup for people who had the problem.  I searched the web but could not find the website or the phone number.  It appears as if Apple is going to e-mail all people who took their iPhones in for repair and were refused yet I have not recieved an e-mail from Apple. 
    I guess the question I have is should I assume since I have had no e-mail from Apple that I will not get one and I will not be included as those getting payment.  Should just take my iPhones with the red liquid sensor to small claims court or should I attempt to contact the judge in the case and ask him how I can have three iPhones that qualify yet have not heard anything from Apple?  I still have the iPhones that Apple refused to repair.

    I don't think the settlement has been approved by the courts yet. Apple agreed to pay, but I don't believe the terms of how everything will go down has been officiated yet. When it is, the documents written up about it stipulate they've got to place a notice in USA today and Macworld with the web address for claims as well as a toll-free number. You can see the terms that are being negotiated at wired.com

  • File iMovie Library.imovielibrary is larger than possible for the drive it's on.

    I've use iMovie '09 for a while and just switched to 10.0.2.  The system created iMovie Library.imovielibrary on the attached drive I use for video files.  This file is huge, in fact it should not fit on the drive it's on.  That is, the space available before it was created has around 100Gb and the file size shown in finder is over 300Gb.  What's going on?

    It will create a new copy of all the files on the other drive because hard links only work within a single drive (partition).  To establish the hard links on the new drive you would have to copy the iMovie 9 folders then update them again in iMovie10 into a library on the new drive (after removing an empty file called something like "Updated to iMovie 10" from the projects and events folders that are put there by iMovie 10 to prevent updating twice.)
    Geoff.

  • New Audigy Beta released today, for the driver hungry people

    Hurry in under Creative's download section and download them, if you need them.
    Please notice they don't work with all Audigy cards and may break compatibilty with the other creative applications such as the mentioned Surround Mixer, THX console and media source player. So these drivers are probably most targeted at the gaming people wanting newest available drivers...
    <EM>Notes:</EM>
    THIS IS AN UNSUPPORTED BETA DRIVER. We recommend that only experienced users install this driver.
    Make sure you uninstall the existing drivers for the audio devices listed above.
    To uninstall the existing drivers:
    Click Start -> Settings -> Control Panel.
    Double-click the Add/Remove Programs icon. The Add/Remove Programs Properties dialog box appears.
    Click the Install/Uninstall tab.
    Select the driver for your audio device and then click the Add/Remove button.</LI>
    Do not install this driver for the Creative Sound Blaster Audigy LS, Sound Blaster Audigy SE or Sound Blaster Audigy Value audio device.
    Some Creative applications such as Surround Mixer, THX Console, and Creative MediaSource? may not work properly with this beta driver.</LI>

    The full details (and filename) for this release:
    <TABLE id=Table5 borderColor=#cccccc cellSpacing=0 cellPadding=3 width=540 border=>
    <TBODY>
    <TR>
    <TD colSpan=2><B>Filename: </B><B>SBA2_PCDrvBeta_LB_2_08_0002.exe</B></TD></TR>
    <TR>
    <TD colSpan=2>Creative Sound Blaster Audigy unified series Beta driver with OpenAL support 2.08.0002 SBA2-BETAD-W-LB
    <DIV id=ShortDesc>
    This beta driver is recommended for gamers who want full OpenAL? support for their audio devices. Only the following audio devices are supported:
    Creative Sound Blaster Audigy? series, Sound Blaster Audigy Platinum series, Sound Blaster Audigy Platinum eX series
    Creative Sound Blaster? Audigy 2 series including Sound Blaster Platinum, Sound Blaster Platinum eX and Sound Blaster Value
    Creative Sound Blaster Audigy 2 ZS series including Sound Blaster Platinum and Sound Blaster Platinum Pro
    Creative Sound Blaster Audigy 4 series
    Creative Sound Blaster Audigy 2 ZS Notebook series</LI>
    <DIV id=Features>
    <EM>Added Features or Enhancements:</EM>
    Provides full OpenAL / EAX? ADVANCED HD support
    Improves performance of all OpenAL game titles</LI>
    <DIV id=Notes>
    <EM>Requirements:</EM>
    Microsoft? Windows? XP Service Pack 2 or Windows 2000 Service Pack 4
    Audio devices listed above only</LI>
    <EM>Notes:</EM>
    THIS IS AN UNSUPPORTED BETA DRIVER. We recommend that only experienced users install this driver.
    Make sure you uninstall the existing drivers for the audio devices listed above.
    To uninstall the existing drivers:
    Click Start -> Settings -> Control Panel.
    Double-click the Add/Remove Programs icon. The Add/Remove Programs Properties dialog box appears.
    Click the Install/Uninstall tab.
    Select the driver for your audio device and then click the Add/Remove button.</LI>
    Do not install this driver for the Creative Sound Blaster Audigy LS, Sound Blaster Audigy SE or Sound Blaster Audigy Value audio device.
    Some Creative applications such as Surround Mixer, THX Console, and Creative MediaSource? may not work properly with this beta driver.</LI>
    </TD></TR></TBODY></TABLE>
    Cat

  • Best place for the sub.

    Hi,
    I have a 2.1 speaker system (I-trigue 3400) and was wondering if anybody knows the best place to put the sub so you can hear the deep bass more, it is infront of my legs now, and when i bend down i can hear more, but when i put it above my head i cant hear it again.

    To find the best place for a sub is quite complicated. The distance from walls, corners and other objects makes a huge difference. One way is to place the sub where you will be sitting; put it as close to where your head will be as you can. Then play some music with nice deep bass and crawl around the floor. You should notice that there are areas where the bass is louder, these are the best spots to place the sub.

  • Multiple key cache lookup cases for the same values

    Hi,
    Just curious whether someone else on this forum has dealt with this use case: we'd like to use the Coherence cache to store objects of say class Foo with fields a and b (Foo(a,b)) using a as the key. The named cache is backed by a database and puts will insert into the corresponding Foo table and gets will either result in a cache hit or read through using a CacheStore implementation we'd write.
    Now, for the 2nd requirement, we need to look up the same objects using field b (or a combination of different fields for that matter). Currently we are thinking of a 2nd named cache that maps b onto Foo(a,b) with a possible optimization that the 2nd cache will map b onto a so the client doing the get can turn around and query the first cache using a. Puts in the first cache will add entries to the second cache to keep the 2nd cache up to date with a -> b mappings. The optimization prevents Foo being stored in two caches.
    Note that we will not store all entries for Foo in the cache as the sheer number of expected entries makes this option not feasible hence we cannot rely on a cache query (using indexes) to look the object up.
    Any comments on this approach or ideas on how to implement this differently?
    Thanks!
    Marcel.

    Hi Marcel,
    That is correct, QueryMap only operates on entries that are in-memory; there is no way to "query-through" a cachestore for example.
    Given that, I think that your proposed approach (of maintaining a separate b->a mapping) makes sense.
    thanks,
    -Rob

Maybe you are looking for

  • Windows error - No Disk

    For some reason when i connect my ipod to my computer, I know get the following windows error: Windows - No Disk There is no disk in the drive. Please insert a disk into the drive \Device\Harddisk1\DR13 Anyone know why this is happening? Thanks

  • What is the best way to backup to CD's?

    Hello. I am in the process of deleting some of my photos from iPhoto to obtain more space in my HD. When I get a new computer with a larger HD I would like to put these photos back in the new iPhoto Library. There seems to be various ways of burning

  • Valuation class changes for open orders

    what are the reason SAP doesn't recommend to change the Valuation class for open orders or when the  material is in transit.

  • Problem in invoking LiveCycle using EJB

    Hi All, I am trying to invoke LC using EJB protocol. I referred the code example from the link http://help.adobe.com/en_US/livecycle/9.0/programLC/help/index.htm?content=001001.html#154 8359 But I am facing the problem in the same code. Here is the s

  • Is there a feature to allow me to block specific sites?

    This is because of ArcadeYum. This site has started causing other sites to advertise on my PC. Their uninstall instructions are bogus and if you unsubscribe, you still get ads. I need to know how to block them and all of their ad affiliates.