Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- package conn1;
- import java.sql.*;
- /**
- *
- * @author asus
- */
- public class Main {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) throws Exception {
- // TODO code application logic here
- String query="insert into main values('jdbcc',1)";
- Class.forName("com.mysql.jdbc.Driver");
- Connection con=DriverManager.getConnection("jdbc:mysql://localhost/test:3306","localhost ", " ");
- Statement st=con.createStatement();
- int count=st.executeUpdate(query);
- con.close();
- }
- }
Add Comment
Please, Sign In to add comment