1 22 23 package org.xquark.extractor.microsoft; 24 25 import java.sql.*; 26 import java.sql.Connection ; 27 import java.sql.SQLException ; 28 import java.sql.Statement ; 29 30 import org.xquark.extractor.metadata.QNameEncoder; 31 import org.xquark.jdbc.typing.DBMSInfo; 32 33 37 public final class Loader extends org.xquark.extractor.metadata.Loader { 38 39 private static final String RCSRevision = "$Revision: 1.7 $"; 40 private static final String RCSName = "$Name: $"; 41 42 public Loader(Connection connection, DBMSInfo dbmsInfo, QNameEncoder encoder) 43 throws SQLException { 44 super(connection, dbmsInfo, encoder); 45 } 46 47 protected String getDefaultSchema() throws SQLException { 48 Statement statement = null; 49 ResultSet rs = null; 50 try { 51 statement = _connection.createStatement(); 52 rs = statement.executeQuery("select user"); 53 rs.next(); 54 return rs.getString(1); 55 } finally { 56 if (rs != null) rs.close(); 57 if (statement != null) statement.close(); 58 } 59 } 60 } 61 | Popular Tags |