Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.ResultSet;
- import java.sql.Statement;
- import java.sql.Connection;
- import java.sql.SQLException;
- import java.sql.DriverManager;
- public class GUI {
- public static void main(String[] args) throws Exception {
- Connection con = null; //connects to database//
- Statement state = null; //allows to execute queries//
- ResultSet set = null; //represents data from queries that statement has done//
- try {
- Class.forName("oracle.jdbc.driver.OracleDriver");
- con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","kmirshah","08076096");
- state = con.createStatement();
- }
- catch (SQLException exception) {
- exception.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement