Created
February 21, 2011 03:52
-
-
Save maheshmc2/836638 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create table employee ( | |
id Number, | |
name Varchar(20), | |
Primary Key(id) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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