Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package tcf;
- import java.sql.*;
- /**
- *
- * @author ScottJR
- */
- public class Tcf {
- private static final String USERNAME="root";
- private static final String PASSWORD="scooter";
- private static final String CONN_STRING=
- "jdbc:mysql://localhost/Coach_info";
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- Connection conn = null;
- try {
- conn = DriverManager.getConnection(CONN_STRING,USERNAME,PASSWORD);
- System.out.println("Connected!!");
- Statement stmt = (Statement) conn.createStatement();
- String Fname="Shawn";
- String Lname="Scott";
- String insert="INSERT INTO basic_info('Fname','Lname')VALUES('"+Fname+"','"+Lname+"')";
- stmt.executeUpdate(insert);
- }catch(SQLException e){
- System.err.println(e);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement