Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void OkButtonActionPerformed(java.awt.event.ActionEvent evt) {
- // TODO add your handling code here:
- this.account=AccountField.getText().trim();
- this.password=PasswordField.getText();
- System.out.println("Oracle JDBC Connection ");
- try {
- Class.forName("oracle.jdbc.driver.OracleDriver");
- } catch (ClassNotFoundException e) {
- System.out.println("Where is your Oracle JDBC Driver?");
- e.printStackTrace();
- this.status=false;
- return;
- }
- System.out.println("Oracle JDBC Driver Registered!");
- Connection connection = null;
- try {
- connection = DriverManager.getConnection(
- "jdbc:oracle:thin:@192.168.2.2:1521:ELS", this.account,
- this.password);
- } catch (SQLException e) {
- System.out.println("Connection Failed! Check output console");
- e.printStackTrace();
- JOptionPane.showMessageDialog(null, e.toString());
- this.status=false;
- return;
- }
- if(this.status) {
- System.out.println("true");
- setVisible(false);
- }
- ;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement