Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue Fix "Getting this error while connecting new connection wizard #14" #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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