Class.forname:Oracle "Error" cannot resolve Sysmbol

I am stil new in java can you pls help me with this error. I have a main class
i am trying to make an oracle connection but i get this error when I RUN THE CLASS IN DOS
Try.java [61:1] cannot resolve symbol
symbol : method forName (java.lang.String)
location: class Class
Class.forName("oracle.jdbc.driver.OracleDriver");

very simple... add classes12.jar file to classpath

Similar Messages

  • Compiler error cannot resolve symbol

    Hi people,
    i'm having this compile time error that, when i create a class and calling that class in another class gives the error cannot resolve symbol classname and it also happened when i created a bean and referencing the bean class in another bean when i'm using Jsp. thanks in advance.

    It would be helpful if you post the exact error message. If you use a system Classpath, then it must contain the root directory for the package directory(s).
    For example, if the source code for a file starts with
    package my.package;
    and you have a directory structure c:\myjava\classes\my\package then the Classpath must contain c:\myjava\classes.

  • Class error - cannot resolve symbol "MyDocumentListener"

    Hello,
    this is a groaner I'm sure, but I don't see the problem.
    Newbie-itis probably ...
    I'm not concerned with what the class does, but it would be nice for the silly thing to compile!
    What the heck am I missing for "MyDocumentListener" ?
    C:\divelog>javac -classpath C:\ CenterPanel.java
    CenterPanel.java:53: cannot resolve symbol
    symbol : class MyDocumentListener
    location: class divelog.CenterPanel
    MyDocumentListener myDocumentListener = new MyDocumentListener(); // define the listener class
    ^
    CenterPanel.java:53: cannot resolve symbol
    symbol : class MyDocumentListener
    location: class divelog.CenterPanel
    MyDocumentListener myDocumentListener = new MyDocumentListener(); // define the listener class
    ^
    2 errors
    package divelog;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.lang.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.filechooser.*;
    import javax.swing.text.*;
    public class CenterPanel extends JPanel implements ActionListener
    { // Opens class
    static private final String newline = "\n";
    private JTextArea comments;
    private JScrollPane scrollpane;
    private JButton saveButton, openButton;
    private JLabel whiteshark;
    private Box box;
    private BufferedReader br ;
    private String str;
    private JTextArea instruct;
    private File defaultDirectory = new File("C://divelog");
    private File fileDirectory = null;
    private File currentFile= null;
    public CenterPanel()
    { // open constructor CenterPanel
    setBackground(Color.white);
    comments = new JTextArea("Enter comments, such as " +
    "location, water conditions, sea life you observed," +
    " and problems you may have encountered.", 15, 10);
    comments.setLineWrap(true);
    comments.setWrapStyleWord(true);
    comments.setEditable(true);
    comments.setFont(new Font("Times-Roman", Font.PLAIN, 14));
    // add a document listener for changes to the text,
    // query before opening a new file to decide if we need to save changes.
    MyDocumentListener myDocumentListener = new MyDocumentListener(); // define the listener class
    comments.getDocument().addDocumentListener(myDocumentListener); // create the reference for the class
    // ------ Document listener class -----------
    class MyDocumentListener implements DocumentListener {
    public void insertUpdate(DocumentEvent e) {
    Calculate(e);
    public void removeUpdate(DocumentEvent e) {
    Calculate(e);
    public void changedUpdate(DocumentEvent e) {
    private void Calculate(DocumentEvent e) {
    // do something here
    scrollpane = new JScrollPane(comments);
    scrollpane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    saveButton = new JButton("Save Comments", new ImageIcon("images/Save16.gif"));
    saveButton.addActionListener( this );
    saveButton.setToolTipText("Click this button to save the current file.");
    openButton = new JButton("Open File...", new ImageIcon("images/Open16.gif"));
    openButton.addActionListener( this );
    openButton.setToolTipText("Click this button to open a file.");
    whiteshark = new JLabel("", new ImageIcon("images/gwhite.gif"), JLabel.CENTER);
    Box boxH;
    boxH = Box.createHorizontalBox();
    boxH.add(openButton);
    boxH.add(Box.createHorizontalStrut(15));
    boxH.add(saveButton);
    box = Box.createVerticalBox();
    box.add(scrollpane);
    box.add(Box.createVerticalStrut(10));
    box.add(boxH);
    box.add(Box.createVerticalStrut(15));
    box.add(whiteshark);
    add(box);
    } // closes constructor CenterPanel
    public void actionPerformed( ActionEvent evt )
    { // open method actionPerformed
    JFileChooser jfc = new JFileChooser();
    // these do not work !!
    // -- set the file types to view --
    // ExtensionFileFilter filter = new ExtensionFileFilter();
    // FileFilter filter = new FileFilter();
    //filter.addExtension("java");
    //filter.addExtension("txt");
    //filter.setDescription("Text & Java Files");
    //jfc.setFileFilter(filter);
         //Add a custom file filter and disable the default "Accept All" file filter.
    jfc.addChoosableFileFilter(new JTFilter());
    jfc.setAcceptAllFileFilterUsed(false);
    // -- open the default directory --
    // public void setCurrentDirectory(File dir)
    // jfc.setCurrentDirectory(new File("C://divelog"));
    jfc.setCurrentDirectory(defaultDirectory);
    jfc.setSize(400, 300);
    jfc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
    Container parent = saveButton.getParent();
    //========================= Test Button Actions ================================
    //========================= Open Button ================================
    if (evt.getSource() == openButton)
    int choice = jfc.showOpenDialog(CenterPanel.this);
    File file = jfc.getSelectedFile();
    /* a: */
    if (file != null && choice == JFileChooser.APPROVE_OPTION)
    String filename = jfc.getSelectedFile().getAbsolutePath();
    // -- compare the currentFile to the file chosen, alert of loosing any changes to currentFile --
    // If (currentFile != filename)
    // -- get the current directory name -------
    // public File getCurrentDirectory( );
    File f=new File(System.getProperty("user.dir"));
    fileDirectory = jfc.getCurrentDirectory();
    // -- remember the last directory used --
    if (defaultDirectory != fileDirectory)
    {defaultDirectory = fileDirectory;}
    try
    { //opens try         
    comments.getLineCount( );
    // -- clear the old data before importing the new file --
    comments.selectAll();
    comments.replaceSelection("");
    // -- get the new data ---
    br = new BufferedReader (new FileReader(file));
    while ((str = br.readLine()) != null)
    {//opens while
    comments.append(str);
    } //closes while
    } // close try
    catch (IOException ioe)
    { // open catch
    comments.append(newline +"Open command not successful:" + ioe + newline);
    } // close catch
    // ---- display the values of the directory variables -----------------------
    comments.append(
    newline + "The f directory variable contains: " + f +
    newline + "The fileDirectory variable contains: " + fileDirectory +
    newline + "The defaultDirectory variable contains: " + defaultDirectory );
    else
    comments.append("Open command cancelled by user." + newline);
    } //close if statement /* a: */
    //========================= Save Button ================================
    } else if (evt.getSource() == saveButton)
    int choice = jfc.showSaveDialog(CenterPanel.this);
    if (choice == JFileChooser.APPROVE_OPTION)
    File fileName = jfc.getSelectedFile();
    // -- get the current directory name -------
    // public File getCurrentDirectory( );
    File f=new File(System.getProperty("user.dir"));
    fileDirectory = jfc.getCurrentDirectory();
    // -- remember the last directory used --
    if (defaultDirectory != fileDirectory)
    {defaultDirectory = fileDirectory;}
    //check for existing files. Warn users & ask if they want to overwrite
    for(int i = 0; i < fileName.length(); i ++) {
    File tmp = null;
    tmp = (fileName);
    if (tmp.exists()) // display pop-up alert
    //public static int showConfirmDialog( Component parentComponent,
    // Object message,
    // String title,
    // int optionType,
    // int messageType,
    // Icon icon);
    int confirm = JOptionPane.showConfirmDialog(null,
    fileName + " already exists on " + fileDirectory
    + "\n \nContinue?", // msg
    "Warning! Overwrite File!", // title
    JOptionPane.OK_CANCEL_OPTION, // buttons displayed
                        // JOptionPane.ERROR_MESSAGE
                        // JOptionPane.INFORMATION_MESSAGE
                        // JOptionPane.PLAIN_MESSAGE
                        // JOptionPane.QUESTION_MESSAGE
    JOptionPane.WARNING_MESSAGE,
    null);
    if (confirm != JOptionPane.YES_OPTION)
    { //user cancels the file overwrite.
    try {
    jfc.cancelSelection();
    break;
    catch(Exception e) {}
    // ----- Save the file if everything is OK ----------------------------
    try
    { // opens try
    BufferedWriter bw = new BufferedWriter(new FileWriter(fileName));
    bw.write(comments.getText());
    bw.flush();
    bw.close();
    comments.append( newline + newline + "Saving: " + fileName.getName() + "." + newline);
    break;
    } // closes try
    catch (IOException ioe)
    { // open catch
    comments.append(newline +"Save command unsuccessful:" + ioe + newline);
    } // close catch
    } // if exists
    } //close for loop
    else
    comments.append("Save command cancelled by user." + newline);
    } // end-if save button
    } // close method actionPerformed
    } //close constructor CenterPanel
    } // Closes class CenterPanel

    There is no way to be able to see MyDocumentListener class in the way you wrote. The reason is because MyDocumentListener class inside the constructor itself. MyDocumentListener class is an inner class, not suppose to be inside a constructor or a method. What you need to do is simple thing, just move it from inside the constructor and place it between two methods.
    that's all folks
    Qusay

  • Error:cannot resolve Symbol class"name"

    when I have compiled Bean class named SlBean which has primary class named pk, I recevied following error message(I compiled pk class without error) :
    cannot resolve symbol
    symbol : class pk
    location: class SlBean
    public pk ejbCreate(

    Sorry , its not classpath problem. You have to simply import the pk class if its in any package. I am assuming you have packaged your pk class with ejb jar file.
    for eg. if your class is
    package abc.xyz
    public class pk
    then in your bean class import
    import abc.xyz.pk;
    --Ashwani                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Error class not found with Class.forName("oracle.jdbc.driver.OracleDriver")

    sorry Got the solution...!!!!
    Hi
    I am trying to connect to oracle database on the server, oracle client installed on working m/c, I have placed classes111.zip (from oracle 8) in jdk1.1.8demojrelibext folder and I have set the classpath to the ext folder. The code
    try
    Class.forName("oracle.jdbc.driver.OracleDriver");
    catch(Exception e)
    when I run this code , error as
    [[ java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver ]]
    Please reply what are settings I should to to load this oracle driver,
    Thanks
    Mayank
    Message was edited by:
    user560333

    I currently have this same problem. How did you solve yours see my post Cant find suitable driver.

  • Compiling error - cannot resolve symbol

    Hi,
    I am working on writing out this basic code for a project. When I compile, I get an error "Cannot resolve symbol" for the gpa variable. Please help!
    My intention is to use the hours and points from the crHours and nbrPoints methods, and use them to calculate GPA in the grPtAvg method:
    public class Student
         public static void main(String[]args)
    idNum();
    crHours();
    nbrpoints();
    gpa = grPtAvg(hours, points);
    System.out.println("Student's GPA is " + gpa);
    public static void idNum()
    int id = 2520;
    System.out.println("Student's ID is " + id);
    public static float crHours()
    float hours = 5;
    System.out.println("Student's credit hours are " + hours);
    return hours;
    public static float nbrpoints()
    float points = 22;
    System.out.println("Student's earned points are " + points);
    return points;
    public static float grPtAvg(float hours, float points)
    float gpa;
    gpa = points / hours;
    System.out.println("Student's computed GPA is " + gpa);
    return gpa;

    That's because you're doing the same thing (in a somewhat different way) with those.
    The variables: hours and points have already been returned to main methd, right?Yes, but then the main method ignores them.
    So, they should be available at this point in the code, is that right?Available in the sense that you can read them, but not in the sense that there are hours and points variables within scope in the main method.
    You want to do this:
    public static void main(String[] args) {
       idNum();
       float hours = crHours();
       float points = nbrpoints();
       //create a new float
       float myComputetdGpa = grPtAvg(hours, points);
       System.out.println("Student's GPA is " + myComputedGpa);
    }

  • I am getting an error cannot resolve symbol variable?

    I am trying to run a PdfFormGenerator.java file and am using the iText API, hence have included
    the iText.jar file. When I compile the code I keep getting the following two errors:
    cannot resolve symbol variable CLASS_LOCATION
    cannot resolve symbol variable FORM_LOCATION
    can anyone guide me what I may have done wrong.
    Thanks,
    Zub

    Hi! To be more specific its these to line of the code is were I am going the errors:
        private String classLocation = Constants.CLASS_LOCATION;
        private String formLocation = Constants.FORM_LOCATION;Thanks

  • [stupid]error: cannot resolve "libusb1", a dependency of "libdc1394"

    Hi!
    :: Starting full system upgrade...
    resolving dependencies...
    error: cannot resolve "libusb1", a dependency of "libdc1394"
    error: failed to prepare transaction (could not satisfy dependencies)
    :: libdc1394: requires libusb1
    I needed libdc1394 only for gstreamer-plugins-bad, so I removed those. Wanted to try out if I need them anyway. But... What if? Is this a bug, did I do something wrong or did I just update while the required version isn't up yet and should unset testing again?
    EDIT: Uh, sorry, yes, I guess that's just me not waiting for the files to be distributed to the servers I guess.
    EDIT2: At least looks like it, should wait & think instead of type and type. Me drinking to much coffee. Marking thread as "stupid" instead of "solved" now.
    Last edited by whoops (2009-05-03 23:18:02)

    I do not thing archbang is officially  archlinux distributions (you are on an archlinux forum). This error does not appear on the current archlinux distribution. My guess is that here is a confusion between python / python2 / python3. Just run pacman -Si to know (or the equivalent of pacman for archbang).
    I would suggest you to use the official archlinux instead of this fork, archlinux has much more support and users and I do not quite understand what archbang has to offer: Their homepage said that it is archlinux combined with openbox, but you can just do
    pacman -S openbox
    on arch; it does not seems to justify a fork (but please correct me if I am wrong).
    Last edited by olive (2012-06-17 22:00:23)

  • When i try to use max() & pow() in jdbc i get error "cannot resolve symbol"

    hi,
    when i tried to use pow() & max() in my jdbc programme i got compilation error "cannot resolve symbol".
    even i have imorted java.math
    this is the sample.
    pr1= (fy/(L*B*pow(10.0,-6.0))+((6*mx)/(L*B*B*pow(10.0,-6.0)))+((6*mz)/(B*L*L*pow(10.0,-6.0))));
    all of above are double.
    and with max();
    pr=max(pr1,pr2);
    all of above are double.
    please help.
    thanks in advance.
    satish

    hi
    Hartmut
    thanks hartmut;
    i am new in java so i have some problems, but thanks for helping me.
    please help me again.
    as i have already posted another probleme which i have with selecting 1000 rows 1 by 1 from a table & manipulate 1 by 1 on that and then store all manipulated row to another table.
    when i tried to do so i am able to select only 600 rows and manipulate them & store them.
    i did not get any exception or any error.
    can this possible that microsoft access driver has not that much capacity to provide 1000 rows or it is problem with jdbc.
    please help.
    satish
    thanks again.

  • WebHelp Template Error: cannot resolve macro

    RoboHelp HTML 5.0.2 Build 801
    Word 2003 SP3
    I have been working fine until this afternoon. I tried to
    generate webhelp in two different projects. In the output window I
    see messages through Updating files, and then a message flashes and
    it goes to done, but nothign is there to view.
    The message is something like Template Error: cannot resolve
    macro WHH#78 or something like that. I really cannot read it.
    I have look for the answer on this forum and in the Help
    system, to no avail. I will be leaving soon but will come in the
    morning and try to start troubleshooting again. Any ideas that
    might help would be greatly appreciated
    sandy

    Thanks for your time.
    I am using RoboHelp HTML 5.0.2 Build 801
    I have created 5 or 6 help files. I always open them with
    RoboHelp HTML because the primary layout is web help to be
    published to the web.
    I always use the Single Source Layouts in the Project tab to
    generate Printed Documents. I usually use the generate primary
    layout for the web help.
    This is the exact error I get, no matter which of my projects
    I try to generate web help for:
    Template Error: can not resolve macro: WH_CSH2_HTM
    Finished compiling WebHelp in 6 sec(s)
    Should I reinstall WebHelp to fix the corrupted template? If
    so will I have to restore my default.css?
    I am a really plain bread and butter user. I have not
    imported any templates or customized any templates. I have always
    just opened my projects with ROBOhelp HTML and generated.
    (Successfully, I might add, up until now).
    Thanks again for any help you can give me.
    Sandy

  • Error: cannot resolve dependencies for "codecs"

    I receive this error when I'm trying to upgrade codecs 20060501-2 package. It tries to find libstdc++5 which is in Testing repository, and I'm not using Testing.
    error: cannot resolve dependencies for "codecs":
    "libstdc++5" is not in the package set
    I think libstdc++5 should be moved to Current or something like that (You know what to do )...
    Best regards

    Skyscraper wrote:
    I receive this error when I'm trying to upgrade codecs 20060501-2 package. It tries to find libstdc++5 which is in Testing repository, and I'm not using Testing.
    error: cannot resolve dependencies for "codecs":
    "libstdc++5" is not in the package set
    I think libstdc++5 should be moved to Current or something like that (You know what to do )...
    Best regards
    They are in testing repository:
    http://archlinux.org/packages.php?s_rep … ate=&pp=50

  • Error: cannot resolve dependencies for "avahi"

    Greetings:
    I get the following message when I run paman -Syu
    :: Replace mkinitrd with mkinitcpio from "current"? [Y/n]
    error: cannot resolve dependencies for "avahi":
    "dbus" is not in the package set
    So, I thougth I'd get rid of avahi, but pacman -R avahi returns:
    error: this will break the following dependencies:
    avahi: is required by gnome-vfs
    I've tried removing dbus from the daemons in rc.conf. I've tired restating dbus folloing instrcutions from another thread here.
    Pacman -Ss dbus returns:
    community/perl-net-dbus 0.33.3-1
    Perl extension for the DBUS message system
    So I am thinking, and am probably completely wrong, that pacman is searching for a repo with dbus in it?
    Color me stumped.

    Yes, I have the default install one uncommented:
    [extra]
    # Add your preferred servers here, they will be used first
    Include = /etc/pacman.d/extra
    Should I add a different one?

  • Error: cannot resolve dependencies for "font..

    what could be that?
    [root@myhost root]# pacman -S -u --sysupgrade
    error: cannot resolve dependencies for "fontconfig":
    fontconfig conflicts with xfree86
    thxs
    (if u can put it in spanish, better )

    but before u post me, updated pacman, and then, not send me that error

  • solved error: cannot resolve dependencies for "hal"

    Hello all,
    I tried doing a pacman -Syu today and recieved the following: error: cannot resolve dependencies for "hal"
    Then I did a pacman -S dbus-glib and got : dbus-glib: not found in sync db
    then I did pacman -S dbus and recieved the same message.
    Then I did pacman -S hal and got:
    error: cannot resolve dependencies for "hal":
    "dbus-glib" is not in the package set
    Am I missing something? Any help would be greatly appreciated.
    Oh man, in my fleeting moment of panic I didn't think things through and posted right away.
    I commented the following lines in pacman.conf and now it works
    #XferCommand = /usr/bin/aria2c -s 2 -m 2 -o %o %u
    #XferCommand = /usr/bin/pacget %u %o
    Not too sure why, but I am happy all is working.
    Last edited by Cancel (2007-02-17 08:15:54)

    I followed this wiki and it did make a difference. It is still very fast downloading packages.
    http://wiki.archlinux.org/index.php/Imp … erformance
    I haven't had a chance to uncomment those lines again to see if it still gives me errors, but you might have luck trying what the wiki suggests.
    After following the wiki, pacman tries a bunch of servers to give you the best speed possible (if I remember correctly). I hope this helps you.

  • Need help - method call error cannot resolve symbol

    My code compiles fine but I continue to receive a method call error "cannot resolve symbol - variable superman" - can't figure out why. Here is my code:
    public static String caesar(String message, int shift)
    {   [b]String result = "";
    for(int i = 0; i < message.length(); ++i)
    {   [b]char newChar = message.charAt(i + shift);
    result += newChar;
    return result.toUpperCase();
    I entered "superman" for message and "3" for the shift. Can someone please help? Thanks!

    Your post worked great - especially since it made me realize I was going about it all wrong! I was attempting to convert "superman" to "vxshupdq" - basically a cipher shift starting at index 0 and shifting it 3 character values which would result in s changing to v. I restructured my code:
    public static String caesar(String message, int shift)
    {   [b]String result = "";
    for(int i = 0; i < message.length(); ++i)
    {   [b]char newChar = message.charAt(i);
    result += (newChar + shift) % message.length();
    return result.toUpperCase();
    But it's displaying the result as a "60305041". How can I get it to display the actual characters?

Maybe you are looking for

  • How can I use Apple TV with iPhone 4S and no home Internet connection?

    Ok here is the situation.  I'm at my grandparents house where I have the following setup; NO home Internet connection iPhone 4S Verizon carrier with unlimited data plan Apple TV (I believe it's the latest one) Lynksys router What I would like to do i

  • Dragging layers over open documents to the destination blanks them out

    This has happened since CS5 I think.  When I select an area to copy into another document, I am so used to dragging it over to the destination document.  Sometimes I have more than one document open at a time and dragging over them blanks them out. 

  • JAXB looking for tag type rather than tag name?

    Hi everyone. I'm trying to use JAXB to load an xml file, [http://www.unimod.org/xml/unimod.xml|http://www.unimod.org/xml/unimod.xml] . The schema is at [http://www.unimod.org/xmlns/schema/unimod_2/unimod_2.xsd|http://www.unimod.org/xmlns/schema/unimo

  • Operating System authentication

    Hi, I have a question about Operating System authentication: How can I find out the OSDBA and OSOPER groups after I installed Oracle? Is there any data dictionary view to find out this groups. I run Oracle 9.2 on Sun Solaris and want to change from p

  • Dynamic Approver Group

    Hi all, Is there a way to let the dynamic approver group to return more than one record? for one record we return the person_id in the format 'PERSON_ID:'||PERSON_ID Could we use 'PERSON_ID:'||PERSON_ID||',PERSON_ID:'||PERSON_ID for example to retrie