-
Notifications
You must be signed in to change notification settings - Fork 18
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
base: dev
Are you sure you want to change the base?
Conversation
|
||
public static void main (String[]args) throws NonexistentEntityException, Exception{ | ||
PopulateDB.fullSetupDB("prosub", "root", ""); | ||
//PopulateDB.recreateDB("prosub", "root", ""); |
There was a problem hiding this comment.
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", ""); |
There was a problem hiding this comment.
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..."); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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..."); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
Alterações feitas |
No description provided.