السلام عليكم ورحمة الله تعالى وبركاته
شكرا على المجهود الذي تبذلونه لمساعدتنا و لعمل المواضيع المفيدة و انا افعل الضد مشاكل و اسئلة.... :excl:
لدي مشكلة اخرى
هذا هو الكود
package nizar;
import java.sql.DriverManager;
import java.sql.Connection;
public class ConnectionSample
{
// Below is the format of jdbc url for MySQL database.
public static final String URL =
"jdbc:mysql://localhost:3306/nizarnizario";
// The username for connecting to the database
public static final String USERNAME = "root";
// The password for connecting to the database
public static final String PASSWORD = "root";
public static void main(String[] args) throws Exception
{
Connection connection = null;
try
{
// Register a database jdbc driver to be used by
// our program. In this example I choose a MySQL
// driver.
Class.forName("com.mysql.jdbc.Driver");
// Get the connection object from the driver manager
// by passing the url of our database, username and
// the password.
connection = DriverManager.getConnection(URL,
USERNAME, PASSWORD);
// Do what ever you want to do with the connection
// object, such as reading some records from database,
// updating or deleting a row. But don't forget the
// close the connection right after you've finished
// using it.
} finally
{
if (connection != null)
{
connection.close();
}
}
}
}وجدته في احد المواقع الاجنبية على العموم يظهر هذا الخطأ
Exception in thread "main" java.lang.ClassNotFoundException: com.mysql.jdbc.Driver at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:171) at nizar.ConnectionSample.main(ConnectionSample.java:30) Java Result: 1
ارجوا الحل فانا اريد عمل اتصال بين برنامجي و mysql
وشكرا لكم واسف على الازعاج
و السلام عليكم ورحمة الله تعالى وبركاته


