hi
I am trying to connect to Mysql Database using the folling code.But not able to do it Database name is StudentPerformance.Please Guide Me where and what is the problem in this code
thanks
ANSHUL
*****************CODE***************
import java.sql.*;
public class SQLFirst
{
public static void main(
String agrs[])
{
Statement stmt1;
ResultSet rs1;
DatabaseMetaData dbms1;
try
{
Class.forName("com.mysql.jdbc.Driver");
}
catch (Exception e)
{
System.out.println("Error" + e);
}
try
{
Connection conn1 = DriverManager.getConnection("jdbc:mysql:StudentPerformance");
stmt1 = conn1.createStatement();
rs1 = stmt1.executeQuery("Select * from patients");
dbms1 = conn1.getMetaData();
System.out.println("DATABASE NAME" + dbms1.getDatabaseProductName());
}catch(Exception e)
{
System.out.println("Error" + e);
}
}
}