exception at runtime



Share on Google+Share on Google+

exception at runtime
1 Answer(s)      7 years ago
Posted in : JDBC
while i executing this source code:-
import java.sql.*;

public class MysqlConnect
public static void main(String args[])
System.out.println("MySQL Connect Example.");
Connection con = null;
String url = "jdbc:mysql://localhost:3306/";
String dbName = "bank";
String driver = "com.mysql.jdbc.Driver";
String userName = "root";
String password = "1234";
try {
con = DriverManager.getConnection(url+dbName,userName,password);
System.out.println("Connected to the database");
System.out.println("Disconnected from database");
catch (Exception e)

i got an exception that exception in
thread main java.lang.noclassdeffounderror :class_name. how can i remove this exception. i am executing my prgm on command prompt in window 7. is there is problem in setting the classpath then give me step to step procedure to correct this problem.i am using mysql-essential-5.0.41-win32_1. pls help
thanks in advance
View Answers

August 20, 2010 at 1:49 PM

Hi Friend,

Use mysql-connector-java-5.0.5.jar file.



Related Tutorials/Questions & Answers:
runtime exception hibernate
runtime exception hibernate  runtime exception hibernate
java runtime exception - JDBC
java runtime exception  while i executing this source code:- import..."); } catch (Exception e) { e.printStackTrace(); } } } i got an exception that classnotfoundexception . how can i remove
exception at runtime - JDBC
exception at runtime  while i executing this source code:- import... (Exception e) { e.printStackTrace(); } } } i got an exception that exception in thread main java.lang.noclassdeffounderror :class_name. how can i
RunTime Exception in stand alone app with hibernate. - Hibernate
RunTime Exception in stand alone app with hibernate.  I have written small stand alone application using hibernate-3.2. When I run the application, It causes following types of exceptions. log4j:WARN Please initialize
Java Runtime Exception: 0x4F4F:524A 0x4120:5445 0x4348:0D0A
Java Runtime Exception: 0x4F4F:524A 0x4120:5445 0x4348:0D0A   Sir I... server error INFO: Java Runtime Exception: 0x4F4F:524A 0x4120:5445 0x4348:0D0A... some error-- Client side error: Exception in thread "AWT-EventQueue-0
Exception  1.Create a class Errorhandle3. Write code that demonstrates how handle and declare rules are different for runtime exceptions and checked exceptions
exception  chek in and check out exception in java   Please visit the following link: Checked and Unchecked Exception
arguments are not equalto two,throw a user defined exception "invalid parameter exception" ,otherwise display the two parameters.   Here is an example... is not equal to two then invalid parameter exception is thrown ,otherwise display the two
exception  what is the use of catch block even though we have predefined exception object
exception  example for numberformat exception   Hi Friend, Try the following code: class NumberFormatExceptionEx{ public static void...); } catch(Exception e){ System.out.println(e
defined checked exception ââ?¬Å?InvalidCharcterFoundExceptionââ?¬Â? and creater a block of codes that will handle the exception
Exception  whis is the Arithmetic Exception in java? or define Arithmetic Exception with exp?   Arithmetic Exception occurs, when you divide a number by zero. Example public class TryCatch { public static void main
Exception  public class FooException extends Exception { public..."); } public void calculate() throws FooException, Exception { try { int.... ex.printStackTrace(); System.exit(1); } catch(Exception ex
Exception   I was creating a table dynamically but it shows exception i.e shown down Suplier created0 Suplier created0 Suplier created0 Product created0 Product created0 Product created0 Product created0 could not fetch initial
user defined unchecked exception  can we create user defined unchecked exceptions? if so what is the exact use of it in real time?   Please visit the following links: http://www.roseindia.net/java/java-exception/user
exception  Identify the reason for SQLException exception, which is encountered when the developer tries to run the following code snippet to insert..."); ps.executeUpdate(); } catch(Exception e
Number Format Exception
Number Format Exception       NumberFormatException is a subclass of the Runtime Exception class.  A Number Format Exception occurs in the java code when a programmer tries
Exception - Struts
Exception - java.lang.reflect.InvocationTargetException  ...: java.lang.reflect.InvocationTargetException: This is a checked exception that extends Exception Class thrown... is occured at the runtime or construction time via the getTargetException() method
Runtime error
Runtime error  I have written 3n+1 code in java and it gives correct o/p but when i submit my code online for my contest it says runtime error.. how to know where is problem
Runtime Class
Runtime Class  How can we halt d execution withd help of exit(arg) method?? ...pls tag a code
exception handling
exception handling  What is an exception and what are the advantages of exception handling mechanism.   Java Exception Exception are the runtime errors. Advantages: 1)Exception provides the means to separate
runtime error
runtime error  still i am getting runtime error as:the specified dsn contains an architecture mismatch between the driver and application   Hi, This error is related to some OS related problem. "dsn contains
Java Exception
Java Exception  Why Runtime Exceptions are Not Checked
thread runtime process
thread runtime process  Java thread runtime process
runtime error in java
runtime error in java  What is Run time error in Java?   Run time error is a syntax error that during the execution of a program.It hash...-exception/exception-java.shtml
exception handling
exception handling  explain about exception handling
Java Exception
this exception will be caught by a well-written application and will also prompt... are the exceptions which occur during the runtime of the program. Unchecked exceptions... of an API. These type of exceptions are also called Runtime exceptions that are usually
runtime error - Java Beginners
runtime error  I created a sample java source ,compiled it succesfully using command prompt but when i tried to run i got the folowing error " Exception in thread "main" java.lang.UnsupportedClassVersionError" I have set
java runtime error - JDBC
java runtime error  when i am running my jdbc program using thin driver this error is coming at runtime: Exception in thread "main.... Sol: This exception can occur when the source is built targeting a JDK


Advertisement null