Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
544 B
0
Indexable
Never
package com.hospital;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ForConnection {public static Connection getConnection()
{
	Connection conn=null;
	try {
		Class.forName("com.mysql.cj.jdbc.Driver");
		
		String dburl="Jdbc:mysql://localhost:3306/hospital?user=root&password=root";
		conn=DriverManager.getConnection(dburl);
	} catch (ClassNotFoundException | SQLException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}

	
	return conn;}

}