• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

classpath

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
/**from here**/
try
{

Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/db","loginName","password");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from test");
while(rs.next())
{
System.out.println(rs.getString("name"));
}
}

catch(Exception e)
{
System.out.println(e);
}
/**toHere**/
running, the portion in a pgm in jboss( written in jsp - deployed in a war file ) I get the error
java.lang.ClassNotFoundException: jdbc:mysql://localhost:3306/db
The error is surely because the class path was not set. I'm working on windows.Plz tell me where to set The classpath. I have put the jar file in the lib directory of both jboss and pgm.
I had set Path before executing the run.bat file of jboss

[ February 13, 2005: Message edited by: CS Techno ]
[ February 14, 2005: Message edited by: Bear Bibeault ]
 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

1. go to my computer right click on it go to Advanced Tab click environment variables and then ...if there is classpath edit it or u create it using New button

2. u can use set CLASSPATH=%CLASSPATH%;ur_path;
here first %CLASSPATH% retains current path and then u can include ur locations (i just named it ur_path ..it is not keyword rather my word)

try and tell
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"CS Techno",

We're pleased to have you here with us on the Ranch, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender
 
Bear Bibeault
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hareesh,

JavaRanch is a community of people from all over the world, many of who are not native English speakers. While using abbreviations like "u" instead of spelling out "you" is convenient when text messaging your friends on a cell phone or in a chat room, it presents an extra challenge to those that are already struggling with English. Additionally, such shortcuts may confound automated translation tools that patrons of the Ranch may be making use of.

I would like to ask for your help in making the content of JavaRanch a little easier to read for everybody that visits here by not using such abbreviations.

thanks,
bear
Forum Bartender
 
Hareesh Ram Chanchali
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sure,

i will confine to the policies

Thanks & regards
 
reply
    Bookmark Topic Watch Topic
  • New Topic