< prev index next >

test/jdk/java/sql/testng/util/StubConnection.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -41,10 +41,12 @@
 import java.util.Properties;
 import java.util.concurrent.Executor;
 
 public class StubConnection implements Connection {
 
+    private boolean autoCommit = false;
+
     @Override
     public Statement createStatement() throws SQLException {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 

@@ -63,16 +65,18 @@
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
     @Override
     public void setAutoCommit(boolean autoCommit) throws SQLException {
-        throw new UnsupportedOperationException("Not supported yet.");
+        System.out.println("**** in StubConnection.setAutoCommit");
+        this.autoCommit = autoCommit;
     }
 
     @Override
     public boolean getAutoCommit() throws SQLException {
-        throw new UnsupportedOperationException("Not supported yet.");
+        System.out.println("*** in StubConnection.getAutoCommit");
+        return autoCommit;
     }
 
     @Override
     public void commit() throws SQLException {
         throw new UnsupportedOperationException("Not supported yet.");
< prev index next >