import java.sql.*;
class Ass1
{
public static void main(String args[])
{
try
{
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/data1","user1","user1");
System.out.println("Connection Success");
conn.close();
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
}
}
class Ass1
{
public static void main(String args[])
{
try
{
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/data1","user1","user1");
System.out.println("Connection Success");
conn.close();
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
}
}
No comments:
Post a Comment