You are on page 1of 2

package newscheduling;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.ResultSet;

import java.sql.SQLException;

import java.sql.Statement;

public class NEWSCHEDULING {

public static void main(String[] args)throws SQLException {

String url="\"jdbc:mysql://localhost:3306\",\"root\",\"12345\"";

String uname="root";

String password="12345";

String query="SELECT * FROM data.login;";

private String query;

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="";

for(int i=1;i <= 6;i++){

Schedule +=result.getString(i)+"i";

System.out.println(Schedule);

}catch(SQLException e){

e.printStackTrace();

You might also like