Skip to content

Instantly share code, notes, and snippets.

@maheshmc2
Created February 21, 2011 03:52
Show Gist options
  • Save maheshmc2/836638 to your computer and use it in GitHub Desktop.
Save maheshmc2/836638 to your computer and use it in GitHub Desktop.
Create table employee (
id Number,
name Varchar(20),
Primary Key(id)
)
package database;
import java.sql.*;
public class Test1 {
public static void main(String... args) throws Exception{
String driver = "oracle.jdbc.driver.OracleDriver";
Class.forName(driver);
String url = "jdbc:oracle:thin:@localhost:1521:xe";
String userid = "MEW";
String password = "mahesh";
Connection connection = DriverManager.getConnection(url, userid, password);
Statement stmt = connection.createStatement();
stmt.execute("Insert into employee values(19,'priyanka')");
System.out.println("End of Processing...");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment