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 148 #158

Open
wants to merge 15 commits into
base: dev
Choose a base branch
from
Open

Issue 148 #158

wants to merge 15 commits into from

Conversation

bayerlein
Copy link

No description provided.


public static void main (String[]args) throws NonexistentEntityException, Exception{
PopulateDB.fullSetupDB("prosub", "root", "");
//PopulateDB.recreateDB("prosub", "root", "");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remover este comentário. O próprio git faz controle de versão.

public static void main(String[] args) {
try {
PopulateDB.fullSetupDB("prosub", "root", "");
//PopulateDB.recreateDB("prosub", "root", "");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remover.

Class.forName("com.mysql.jdbc.Driver");

//STEP 3: Open a connection
//System.out.println("Connecting to a selected database...");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remover: System.out.println, uma vez que foi substituído por Log

//System.out.println("Database deleted successfully...");
} catch (SQLException | ClassNotFoundException se) {
//Handle errors for JDBC
//se.printStackTrace();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remover: Não faz sentido imprimir o stackTrace.

} catch (SQLException | ClassNotFoundException se) {
//Handle errors for JDBC
//se.printStackTrace();
LOG.info(("" + se));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Não vejo log de exceptions como sendo info(), mas algo como severe().
Além disso, usar método toString() ao invés de concatenação ""+.

LOG.info("Connecting to a selected database...");
conn = DriverManager.getConnection(dbURL, username, password);
LOG.info("Connected database successfully...");
//System.out.println("Connected database successfully...");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remover todos os comentários de System.out.println

}
} catch (SQLException se) {
//se.printStackTrace();
LOG.log(Level.INFO, "{0}", se);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manter padrão do formato de log - veja o comentário anterior. Ou seja, ou utiliza-se curingas {0} ou utiliza-se toString() - escolha um como padrão!
Além disso, log de exception é algo severe().
Faça todos os ajustes necessários nesta classe.

@bayerlein
Copy link
Author

Alterações feitas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants