} } else { canWrite = true; } // Set our initial read-only flag setReadOnly(!canWrite); // Get the directory. It will either be supplied in the property // list, or we’ll use our current default. String s = info.getProperty(”Directory”); if (s == null) { s = System.getProperty(”user.dir”); } setCatalog(s); } Creating Statements From the Connection object, an application can create three types of Statement objects. The base Statement object is used for executing SQL statements directly. The PreparedStatement object (which extends Statement) is used for pre-compiling SQL statements that may contain input parameters. The CallableStatement object (which extends PreparedStatement) is used to execute stored procedures that may contain both input and output parameters. For the SimpleText driver, the createStatement method does nothing more than create a new Statement object. For most database systems, some type of statement context, or handle, will be created. One thing to note whenever an object is created in a JDBC driver: Save a reference to the owning object because you will need to obtain information (such as the connection context from within a Statement object) from the owning object. Consider the createStatement method within the Connection class: public Statement createStatement() throws SQLException { if (traceOn()) { trace(”Creating new SimpleTextStatement”); } // Create a new Statement object SimpleTextStatement stmt = new SimpleTextStatement(); // Initialize the statement stmt.initialize(this); return stmt; }
If you need complete web hosting solution you come to right place,try mac web hosting services.