Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void btnCarregarBackupActionPerformed(java.awt.event.ActionEvent evt) {
- String caminhoArquivo = txtCaminho.getText();
- try {
- if (caminhoArquivo.length() == 0) {
- mm.msgInfo("Informação", "Informe o caminho do arquivo.");
- btnProcurarArquivo.requestFocus();
- } else if (caminhoArquivo.length() > 0) {
- String cmdDOS = "cmd /c mysql -uUser2478 -pUser2478pass numeradortemp < " + caminhoArquivo;
- Runtime r = Runtime.getRuntime();
- Process p = r.exec(cmdDOS);
- p.waitFor();
- mm.msgSucesso("Sucesso", "Dados temporários importados com sucesso."); // mensagem personalizada
- }
- } catch (IOException | InterruptedException e) {
- mm.msgErro("Erro", "Motivo: " + e); // é aqui que ele para, exibindo a exceção
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement