Professional Documents
Culture Documents
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
String url="\"jdbc:mysql://localhost:3306\",\"root\",\"12345\"";
String uname="root";
String password="12345";
void createConnection(){
try{
Class.forName("com.mysql.jdbc.Driver");
}catch(ClassNotFoundException e){
e.printStackTrace();
try{
Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306","root","12345");
Statement statement=con.createStatement();
ResultSet result=statement.executeQuery(query);
while(result.next()){
String Schedule="";
Schedule +=result.getString(i)+"i";
System.out.println(Schedule);
}catch(SQLException e){
e.printStackTrace();