db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r154097 - incubator/derby/code/trunk/java/engine/org/apache/derby/catalog/SystemProcedures.java
Date Wed, 16 Feb 2005 22:59:37 GMT
Author: djd
Date: Wed Feb 16 14:59:35 2005
New Revision: 154097

URL: http://svn.apache.org/viewcvs?view=rev&rev=154097
Log:
Create a single get connection method for the internal system procedures
as a step to not using DriverManager for support under JSR 169.

Modified:
    incubator/derby/code/trunk/java/engine/org/apache/derby/catalog/SystemProcedures.java

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/catalog/SystemProcedures.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/catalog/SystemProcedures.java?view=diff&r1=154096&r2=154097
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/catalog/SystemProcedures.java
(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/catalog/SystemProcedures.java
Wed Feb 16 14:59:35 2005
@@ -137,6 +137,11 @@
 			}
 		}
 	}
+	
+	private static Connection getDefaultConn()throws SQLException
+	{
+		return DriverManager.getConnection("jdbc:default:connection");
+	}
 
 	/**
 	 *  Get the DatabaseMetaData for the current connection for use in
@@ -145,7 +150,7 @@
 	 *  @return The DatabaseMetaData object of the current connection
 	 */
 	private static DatabaseMetaData getDMD() throws SQLException {
-		Connection conn = DriverManager.getConnection("jdbc:default:connection");
+		Connection conn = getDefaultConn();
 		return conn.getMetaData();
 	}
 
@@ -493,7 +498,7 @@
 		throws SQLException
 	{
 		
-		Connection conn = DriverManager.getConnection("jdbc:default:connection");
+		Connection conn = getDefaultConn();
 		PreparedStatement ps = conn.prepareStatement("execute statement SYSIBM.METADATA");
 		rs[0] = ps.executeQuery();
 		conn.close();
@@ -564,8 +569,7 @@
             "alter table " + schema + "." + tablename + " compress" + 
             (sequential != 0 ? " sequential" : "");
 
-		Connection conn = 
-            DriverManager.getConnection("jdbc:default:connection");
+		Connection conn = getDefaultConn();
 
 		conn.prepareStatement(query).executeUpdate();
 
@@ -826,8 +830,7 @@
 	String  codeset)
         throws SQLException
     {
-		Connection conn = 
-            DriverManager.getConnection("jdbc:default:connection");
+		Connection conn = getDefaultConn();
 		Export.exportTable(conn, schemaName , tableName , fileName ,
 							  columnDelimiter , characterDelimiter, codeset);
 		//export finished successfully, issue a commit 
@@ -854,8 +857,7 @@
 	String  codeset)
         throws SQLException
     {
-		Connection conn = 
-            DriverManager.getConnection("jdbc:default:connection");
+		Connection conn = getDefaultConn();
 		Export.exportQuery(conn, selectStatement, fileName ,
 							   columnDelimiter , characterDelimiter, codeset);
 		
@@ -883,8 +885,7 @@
 	short   replace)
         throws SQLException
     {
-		Connection conn = 
-            DriverManager.getConnection("jdbc:default:connection");
+		Connection conn = getDefaultConn();
 		try{
 			Import.importTable(conn, schemaName , tableName , fileName ,
 								   columnDelimiter , characterDelimiter, codeset, replace);
@@ -924,8 +925,7 @@
 	short   replace)
         throws SQLException
     {
-		Connection conn = 
-            DriverManager.getConnection("jdbc:default:connection");
+		Connection conn = getDefaultConn();
 		try{
 			Import.importData(conn, schemaName , tableName ,
 								  insertColumnList, columnIndexes, fileName,
@@ -959,8 +959,7 @@
 	)
         throws SQLException
     {
-		Connection conn = 
-            DriverManager.getConnection("jdbc:default:connection");
+		Connection conn = getDefaultConn();
 		
 		String entityName = (schemaName == null ? tableName : schemaName + "." + tableName); 
 		String binsertSql = 



Mime
View raw message