Advertisement
Guest User

Untitled

a guest
May 22nd, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.83 KB | None | 0 0
  1. package br.edu.ifce.bd.crud;
  2.  
  3.  
  4. import java.sql.Connection;
  5. import java.sql.DriverManager;
  6. import java.sql.SQLException;
  7. import java.sql.Statement;
  8. import java.util.logging.Level;
  9. import java.util.logging.Logger;
  10.  
  11.  
  12.  
  13. /**
  14.  *
  15.  * @author IgorJava()
  16.  */
  17. public class AltosTestes {
  18.    
  19.     public static void main(String[] args){
  20.         try {
  21.             Class.forName("com.mysql.jdbc.Driver");
  22.         } catch (ClassNotFoundException ex) {
  23.             System.out.println("Erro");
  24.         }
  25.         try {
  26.             Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/filmes", "root", "igor");
  27.         } catch (SQLException ex) {
  28.             System.out.println("Erro na conexão");
  29.            
  30.         }
  31.        
  32.         Statement st=conn.createStatement();
  33.         st.executeUpdate("");
  34.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement