Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions Project/src/LMS/Library.java
Original file line number Diff line number Diff line change
Expand Up @@ -595,24 +595,25 @@ public void viewHistory()
/*--------------------------------IN- COLLABORATION WITH DATA BASE------------------------------------------*/

// Making Connection With Database
public Connection makeConnection()
{
public Connection makeConnection()
{
try
{
String host = "jdbc:derby://localhost:1527/LMS";
String uName = "haris";
String uPass= "123";
String host = "jdbc:mysql://localhost:3306/lms";
String uName = "root";
String uPass= "root";
Connection con = DriverManager.getConnection( host, uName, uPass );
System.out.println(con+"database connected succesfully");
return con;

}
catch ( SQLException err )
catch ( SQLException err )
{
System.out.println( err.getMessage( ) );
System.out.println( err.getMessage( ) +"error connecting");
return null;
}
}
}


// Loading all info in code via Database.
public void populateLibrary(Connection con) throws SQLException, IOException
{
Expand Down Expand Up @@ -1212,4 +1213,4 @@ public void fillItBack(Connection con) throws SQLException,SQLIntegrityConstrain



} // Library Class Closed
} // Library Class Closed