Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 203158 | Differences between
and this patch

Collapse All | Expand All

(-)META-INF/MANIFEST.MF (-3 / +14 lines)
Lines 1-5 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
Bundle-ManifestVersion: 2
2
Bundle-ManifestVersion: 2
3
Bundle-Name: Sqlserver Plug-in
3
Bundle-Name:  %pluginName
4
Bundle-SymbolicName: org.eclipse.datatools.enablement.msft.sqlserver
4
Bundle-SymbolicName: org.eclipse.datatools.enablement.msft.sqlserver;singleton:=true
5
Bundle-Version: 1.0.0
5
Bundle-Version: 1.0.1.200710051
6
Bundle-Vendor: %providerName
7
Bundle-Localization: plugin
8
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0)",
9
 org.eclipse.datatools.modelbase.sql;bundle-version="[1.0.0,2.0.0)",
10
 org.eclipse.datatools.connectivity.sqm.core;bundle-version="[1.0.1,2.0.0)",
11
 org.eclipse.datatools.connectivity;bundle-version="[1.0.1,2.0.0)",
12
 org.eclipse.datatools.connectivity.db.generic;bundle-version="[1.0.0,2.0.0)"
13
Eclipse-LazyStart: true
14
Export-Package: org.eclipse.datatools.enablement.msft.internal.sqlserver.connection,
15
 org.eclipse.datatools.enablement.msft.internal.sqlserver.loaders
16
Bundle-RequiredExecutionEnvironment: J2SE-1.4
(-)src/org/eclipse/datatools/enablement/msft/internal/sqlserver/connection/SQLServerDBPropertiesPersistenceHook.java (+17 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2007 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.datatools.enablement.msft.internal.sqlserver.connection;
12
13
import org.eclipse.datatools.connectivity.db.generic.GenericDBPropertiesPersistenceHook;
14
15
public class SQLServerDBPropertiesPersistenceHook extends
16
		GenericDBPropertiesPersistenceHook {
17
}
(-)src/org/eclipse/datatools/enablement/msft/internal/sqlserver/loaders/SQL2005RoutineLoader.java (+203 lines)
Added Link Here
1
package org.eclipse.datatools.enablement.msft.internal.sqlserver.loaders;
2
3
import java.sql.ResultSet;
4
import java.sql.SQLException;
5
import java.sql.Statement;
6
import java.util.Collection;
7
import java.util.List;
8
9
import org.eclipse.datatools.connectivity.sqm.core.definition.DataModelElementFactory;
10
import org.eclipse.datatools.connectivity.sqm.core.definition.DatabaseDefinition;
11
import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
12
import org.eclipse.datatools.connectivity.sqm.core.rte.jdbc.JDBCUserDefinedFunction;
13
import org.eclipse.datatools.connectivity.sqm.internal.core.RDBCorePlugin;
14
import org.eclipse.datatools.connectivity.sqm.loader.IConnectionFilterProvider;
15
import org.eclipse.datatools.connectivity.sqm.loader.JDBCRoutineLoader;
16
import org.eclipse.datatools.modelbase.sql.routines.Routine;
17
import org.eclipse.datatools.modelbase.sql.routines.SQLRoutinesPackage;
18
import org.eclipse.datatools.modelbase.sql.routines.Source;
19
import org.eclipse.datatools.modelbase.sql.schema.Database;
20
import org.eclipse.emf.ecore.EClass;
21
22
public class SQL2005RoutineLoader extends JDBCRoutineLoader {
23
	
24
	public static final String COLUMN_ROUTINE_NAME = "ROUTINE_NAME";
25
	public static final String COLUMN_ROUTINE_CATALOG = "SPECIFIC_CATALOG";
26
	public static final String COLUMN_ROUTINE_SCHEMA = "SPECIFIC_SCHEMA";
27
	public static final String COLUMN_ROUTINE_TYPE = "ROUTINE_TYPE";
28
	public static final String COLUMN_ROUTINE_DEFINITION = "ROUTINE_DEFINITION";
29
30
	private IRoutineFactory mUserDefinedFunctionFactory;
31
	private IRoutineFactory mProcedureFactory;
32
33
	public static class SQL2005ProcedureFactory extends ProcedureFactory {
34
		
35
		private Database database = null;
36
		
37
		public void setDatabase (Database db) {
38
			database = db;
39
		}
40
		
41
		public void initialize(Routine routine, ResultSet rs)
42
			throws SQLException {
43
			String name = rs.getString(COLUMN_ROUTINE_NAME);
44
			
45
			// strip out the version indicator
46
			if (name.indexOf(";") > -1)
47
				name = name.substring(0, name.indexOf(";") -1 );
48
			routine.setName(name);
49
			
50
			String source = rs.getString(COLUMN_ROUTINE_DEFINITION);
51
			loadSource(routine, source, database);
52
		}
53
	}
54
	
55
	public static class SQL2005UserDefinedFunctionFactory extends SQL2005ProcedureFactory {
56
57
		public EClass getRoutineEClass() {
58
			return SQLRoutinesPackage.eINSTANCE.getUserDefinedFunction();
59
		}
60
61
		protected Routine newRoutine() {
62
			return new JDBCUserDefinedFunction();
63
		}
64
	}
65
	
66
	public SQL2005RoutineLoader() {
67
		super(null);
68
	}
69
	
70
	public SQL2005RoutineLoader(ICatalogObject catalogObject) {
71
		super(catalogObject);
72
	}
73
74
	public SQL2005RoutineLoader(ICatalogObject catalogObject,
75
			IConnectionFilterProvider connectionFilterProvider) {
76
		super(catalogObject, connectionFilterProvider);
77
		mUserDefinedFunctionFactory = new SQL2005UserDefinedFunctionFactory();
78
		mProcedureFactory = new SQL2005ProcedureFactory();
79
	}
80
81
	public SQL2005RoutineLoader(ICatalogObject catalogObject,
82
			IConnectionFilterProvider connectionFilterProvider,
83
			IRoutineFactory udfFactory, IRoutineFactory spFactory) {
84
		super(catalogObject, connectionFilterProvider, udfFactory, spFactory);
85
	}
86
87
	protected ResultSet createResultSet() throws SQLException {
88
		String schemaName = getSchema().getName();
89
		String catalogName = getSchema().getCatalog().getName();
90
		String query = "select INFORMATION_SCHEMA.ROUTINES.SPECIFIC_CATALOG as \'" + COLUMN_ROUTINE_CATALOG + "\', " +
91
			"INFORMATION_SCHEMA.ROUTINES.SPECIFIC_SCHEMA as \'" + COLUMN_ROUTINE_SCHEMA + "\', " +
92
			"INFORMATION_SCHEMA.ROUTINES.ROUTINE_NAME as \'" + COLUMN_ROUTINE_NAME + "\', " +
93
			"INFORMATION_SCHEMA.ROUTINES.ROUTINE_DEFINITION as \'" + COLUMN_ROUTINE_DEFINITION + "\', " +
94
			"INFORMATION_SCHEMA.ROUTINES.ROUTINE_TYPE as \'" + COLUMN_ROUTINE_TYPE + "\' " +
95
			"from INFORMATION_SCHEMA.ROUTINES where " +
96
			"INFORMATION_SCHEMA.ROUTINES.SPECIFIC_CATALOG = \'" + catalogName + "\' and " +
97
			"INFORMATION_SCHEMA.ROUTINES.SPECIFIC_SCHEMA = \'" + schemaName + "\'";
98
		if (getJDBCFilterPattern() != null
99
				&& getJDBCFilterPattern().length() > 0) {
100
			String filter = " AND ALIAS LIKE " + getJDBCFilterPattern();//$NON-NLS-1$
101
			query = query + filter;
102
		}
103
		query = query + " ORDER BY " + COLUMN_ROUTINE_NAME;
104
105
		Statement s = getCatalogObject().getConnection().createStatement();
106
		ResultSet r = s.executeQuery(query);
107
		return r;
108
	}
109
110
	protected boolean isProcedure(ResultSet rs) throws SQLException {
111
		return rs.getString(COLUMN_ROUTINE_TYPE).startsWith("P");
112
	}
113
114
	public IRoutineFactory getProcedureFactory() {
115
		return this.mProcedureFactory;
116
	}
117
118
	public IRoutineFactory getUserDefinedFunctionFactory() {
119
		return this.mUserDefinedFunctionFactory;
120
	}
121
122
	protected Routine processRow(ResultSet rs) throws SQLException {
123
		ICatalogObject object = getCatalogObject();
124
		Database database = object.getCatalogDatabase();
125
		if (mProcedureFactory == null) {
126
			mProcedureFactory = new SQL2005ProcedureFactory();
127
			((SQL2005ProcedureFactory) mProcedureFactory).setDatabase(database);
128
		}
129
		if (mUserDefinedFunctionFactory == null) { 
130
			mUserDefinedFunctionFactory = new SQL2005UserDefinedFunctionFactory();
131
			((SQL2005UserDefinedFunctionFactory) mUserDefinedFunctionFactory).setDatabase(database);
132
		}
133
		IRoutineFactory routineFactory = isProcedure(rs) ? mProcedureFactory
134
				: mUserDefinedFunctionFactory;
135
		return routineFactory.createRoutine(rs);
136
	}
137
138
	public void loadRoutines(List containmentList, Collection existingRoutines)
139
		throws SQLException {
140
		ResultSet rs = null;
141
		try {
142
			initActiveFilter();
143
			ICatalogObject object = getCatalogObject();
144
			Database database = object.getCatalogDatabase();
145
			for (rs = createResultSet(); rs.next();) {
146
				String routineName = rs.getString(COLUMN_ROUTINE_NAME);
147
				if (routineName == null || isFiltered(routineName)) {
148
					continue;
149
				}
150
				Routine routine = (Routine) getAndRemoveSQLObject(
151
						existingRoutines, routineName);
152
				if (routine == null) {
153
					routine = processRow(rs);
154
					if (routine != null) {
155
						containmentList.add(routine);
156
					}
157
				}
158
				else {
159
					if (isProcedure(rs)) {
160
						((SQL2005ProcedureFactory) mProcedureFactory).setDatabase(database);
161
						mProcedureFactory.initialize(routine, rs);
162
					}
163
					else {
164
						((SQL2005UserDefinedFunctionFactory) mUserDefinedFunctionFactory).setDatabase(database);
165
						mUserDefinedFunctionFactory.initialize(routine, rs);
166
					}
167
					containmentList.add(routine);
168
					if (routine instanceof ICatalogObject) {
169
						((ICatalogObject) routine).refresh();
170
					}
171
				}
172
			}
173
		}
174
		finally {
175
			if (rs != null) {
176
				closeResultSet(rs);
177
			}
178
		}
179
	}
180
181
	private static void loadSource(Routine routine, String aliasInfo,
182
			Database database) {
183
		if (aliasInfo == null || aliasInfo.trim().length() == 0) 
184
			return;
185
		int index = aliasInfo.indexOf("begin"); //$NON-NLS-1$
186
187
		// if it doesn't have any source, then don't bother
188
		if (index == -1) return;
189
		
190
		// otherwise process the source
191
		String body = aliasInfo.substring(index);
192
		final DatabaseDefinition definition = RDBCorePlugin.getDefault()
193
				.getDatabaseDefinitionRegistry().getDefinition(database);
194
		final DataModelElementFactory factory = definition
195
				.getDataModelElementFactory();
196
197
		Source s = (Source) factory.create(SQLRoutinesPackage.eINSTANCE
198
				.getSource());
199
		s.setBody(body);
200
		routine.setSource(s);
201
	}
202
203
}
(-)src/org/eclipse/datatools/enablement/msft/internal/sqlserver/loaders/SQL2005SchemaLoader.java (+36 lines)
Added Link Here
1
package org.eclipse.datatools.enablement.msft.internal.sqlserver.loaders;
2
3
import java.sql.ResultSet;
4
import java.sql.SQLException;
5
import java.sql.Statement;
6
7
import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
8
import org.eclipse.datatools.connectivity.sqm.loader.JDBCSchemaLoader;
9
10
public class SQL2005SchemaLoader extends JDBCSchemaLoader {
11
12
	public SQL2005SchemaLoader() {
13
		super(null);
14
	}
15
	
16
	public SQL2005SchemaLoader(ICatalogObject catalogObject) {
17
		super(catalogObject);
18
	}
19
20
	protected ResultSet createResultSet() throws SQLException {
21
		String query = "select INFORMATION_SCHEMA.SCHEMATA.CATALOG_NAME as \'" + COLUMN_TABLE_CATALOG + "\', INFORMATION_SCHEMA.SCHEMATA.SCHEMA_NAME as \'" + COLUMN_TABLE_SCHEM + "\' from INFORMATION_SCHEMA.SCHEMATA where INFORMATION_SCHEMA.SCHEMATA.CATALOG_NAME = \'" + getCatalog().getName() + "\'";  
22
//		String query = "select sys.database_principals.name \'" + COLUMN_TABLE_CATALOG + "\', sys.database_principals.default_schema_name \'" + COLUMN_TABLE_SCHEM + "\' from sys.database_principals where not sid is null order by sys.database_principals.name";
23
		if (getJDBCFilterPattern() != null
24
				&& getJDBCFilterPattern().length() > 0) {
25
			String filter = " AND ALIAS LIKE " + getJDBCFilterPattern();//$NON-NLS-1$
26
			query = query + filter;
27
		}
28
		query = query + " ORDER BY " + COLUMN_TABLE_SCHEM;
29
30
		Statement s = getCatalogObject().getConnection().createStatement();
31
		ResultSet r = s.executeQuery(query);
32
		return r;
33
	}
34
35
}
36
(-)src/org/eclipse/datatools/enablement/msft/internal/sqlserver/connection/JDBCSQLServerConnectionFactory.java (+35 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2007 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
12
package org.eclipse.datatools.enablement.msft.internal.sqlserver.connection;
13
14
import org.eclipse.datatools.connectivity.IConnection;
15
import org.eclipse.datatools.connectivity.IConnectionFactory;
16
import org.eclipse.datatools.connectivity.IConnectionProfile;
17
18
public class JDBCSQLServerConnectionFactory implements IConnectionFactory {
19
20
	public JDBCSQLServerConnectionFactory() {
21
		super();
22
	}
23
24
	public IConnection createConnection(IConnectionProfile profile) {
25
		JDBCSQLServerJDBCConnection connection = new JDBCSQLServerJDBCConnection(profile,
26
				getClass());
27
		connection.open();
28
		return connection;
29
	}
30
31
	public IConnection createConnection(IConnectionProfile profile, String uid,
32
			String pwd) {
33
		return createConnection(profile);
34
	}
35
}
(-)plugin.properties (+32 lines)
Added Link Here
1
###############################################################################
2
# Copyright (c) 2006, 2007 IBM Corporation and others.
3
# All rights reserved. This program and the accompanying materials
4
# are made available under the terms of the Eclipse Public License v1.0
5
# which accompanies this distribution, and is available at
6
# http://www.eclipse.org/legal/epl-v10.html
7
# 
8
# Contributors:
9
#     IBM Corporation - initial API and implementation
10
###############################################################################
11
pluginName=Eclipse Data Tools Platform Microsoft SQL Server Plug-in
12
providerName=Eclipse.org
13
14
driverClass = Driver Class
15
driverVendor = Vendor
16
driverVersion = Version
17
driverDBName = Database Name
18
driverConnectionURL = Connection URL
19
driverUID = User ID
20
driverPWD = Password
21
22
SQLSERVER_CATEGORY_NAME = SQL Server
23
2005_VERSION_CATEGORY_NAME = 2005
24
2000_VERSION_CATEGORY_NAME = 2000
25
26
org.eclipse.datatools.enablement.msft.sqlserver.2005.driverTemplate = Microsoft SQL Server 2005 JDBC Driver
27
org.eclipse.datatools.enablement.msft.sqlserver.2000.driverTemplate = Microsoft SQL Server 2000 Driver for JDBC
28
org.eclipse.datatools.enablement.msft.sqlserver.2005.other.driverTemplate = Other Driver
29
org.eclipse.datatools.enablement.msft.sqlserver.2000.other.driverTemplate = Other Driver
30
31
jdbc.connection.name = JDBC Connection
32
profile.sqlserver.title = SQL Server
(-)plugin.xml (+300 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<?eclipse version="3.0"?>
3
<plugin>
4
	<extension
5
         point="org.eclipse.datatools.connectivity.connectionProfile">
6
      <connectionProfile
7
            category="org.eclipse.datatools.connectivity.db.category"
8
            configurationType="org.eclipse.datatools.connectivity.db.generic.configurationType"
9
            icon="icons/jdbc_16.gif"
10
            id="org.eclipse.datatools.enablement.msft.sqlserver.connectionProfile"
11
            name="%profile.sqlserver.title"
12
            pingFactory="org.eclipse.datatools.enablement.msft.internal.sqlserver.connection.JDBCSQLServerConnectionFactory"
13
            propertiesPersistenceHook="org.eclipse.datatools.enablement.msft.internal.sqlserver.connection.SQLServerDBPropertiesPersistenceHook"/>
14
      <connectionFactory
15
            class="org.eclipse.datatools.enablement.msft.internal.sqlserver.connection.JDBCSQLServerConnectionFactory"
16
            id="java.sql.Connection"
17
            name="jdbc.connection.name"
18
            profile="org.eclipse.datatools.enablement.msft.sqlserver.connectionProfile"/>
19
   </extension>
20
   
21
	<extension
22
         point="org.eclipse.datatools.connectivity.driverExtension">    
23
         <category
24
      		parentCategory="org.eclipse.datatools.connectivity.db.driverCategory"
25
            id="org.eclipse.datatools.enablement.msft.sqlserver.driverCategory"
26
            name="%SQLSERVER_CATEGORY_NAME"/>
27
         <category
28
      		parentCategory="org.eclipse.datatools.enablement.msft.sqlserver.driverCategory"
29
            id="org.eclipse.datatools.enablement.msft.sqlserver.2005.driverCategory"
30
            name="%2005_VERSION_CATEGORY_NAME"/> 
31
         <category
32
      		parentCategory="org.eclipse.datatools.enablement.msft.sqlserver.driverCategory"
33
            id="org.eclipse.datatools.enablement.msft.sqlserver.2000.driverCategory"
34
            name="%2000_VERSION_CATEGORY_NAME"/> 
35
      
36
      <driverTemplate
37
            createDefault="false"
38
            emptyJarListIsOK="false"
39
            id="org.eclipse.datatools.enablement.msft.sqlserver.2005.driverTemplate"
40
            jarList="sqljdbc.jar"
41
            name="%org.eclipse.datatools.enablement.msft.sqlserver.2005.driverTemplate"
42
            parentCategory="org.eclipse.datatools.enablement.msft.sqlserver.2005.driverCategory">
43
         <properties>
44
            <property
45
                  generated="false"
46
                  id="org.eclipse.datatools.connectivity.db.driverClass"
47
                  name="%driverClass"
48
                  value="com.microsoft.sqlserver.jdbc.SQLServerDriver"
49
                  required="true"
50
                  visible="true"/>
51
            <property
52
                  generated="false"
53
                  id="org.eclipse.datatools.connectivity.db.vendor"
54
                  name="%driverVendor"
55
                  value="SQL Server"
56
                  required="true"
57
                  visible="false"/>
58
            <property
59
                  generated="false"
60
                  id="org.eclipse.datatools.connectivity.db.version"
61
                  name="%driverVersion"
62
                  value="2005"
63
                  required="true"
64
                  visible="false"/>   
65
            <property
66
                  generated="false"
67
                  id="org.eclipse.datatools.connectivity.db.databaseName"
68
                  name="%driverDBName"
69
                  value="pubs"
70
                  required="true"
71
                  visible="true"/>                             
72
            <property
73
                  generated="false"
74
                  id="org.eclipse.datatools.connectivity.db.URL"
75
                  name="%driverConnectionURL"
76
                  value="jdbc:sqlserver://localhost:1433;databaseName=pubs"
77
                  required="true"
78
                  visible="true"/>
79
            <property
80
                  generated="false"
81
                  id="org.eclipse.datatools.connectivity.db.username"
82
                  name="%driverUID"
83
                  value=""
84
                  required="false"
85
                  visible="true"/>
86
            <property
87
                  generated="false"
88
                  id="org.eclipse.datatools.connectivity.db.password"
89
                  name="%driverPWD"
90
                  required="false"
91
                  visible="true"/>
92
         </properties>
93
      </driverTemplate>
94
   </extension>
95
   
96
   <extension
97
         point="org.eclipse.datatools.connectivity.driverExtension">    
98
      <driverTemplate
99
            createDefault="false"
100
            emptyJarListIsOK="false"
101
            id="org.eclipse.datatools.enablement.msft.sqlserver.2000.driverTemplate"
102
            jarList="msbase.jar;mssqlserver.jar;msutil.jar"
103
            name="%org.eclipse.datatools.enablement.msft.sqlserver.2000.driverTemplate"
104
            parentCategory="org.eclipse.datatools.enablement.msft.sqlserver.2000.driverCategory">
105
         <properties>
106
            <property
107
                  generated="false"
108
                  id="org.eclipse.datatools.connectivity.db.driverClass"
109
                  name="%driverClass"
110
                  value="com.microsoft.jdbc.sqlserver.SQLServerDriver"
111
                  required="true"
112
                  visible="true"/>
113
            <property
114
                  generated="false"
115
                  id="org.eclipse.datatools.connectivity.db.vendor"
116
                  name="%driverVendor"
117
                  value="SQL Server"
118
                  required="true"
119
                  visible="false"/>
120
            <property
121
                  generated="false"
122
                  id="org.eclipse.datatools.connectivity.db.version"
123
                  name="%driverVersion"
124
                  value="2000"
125
                  required="true"
126
                  visible="false"/>   
127
            <property
128
                  generated="false"
129
                  id="org.eclipse.datatools.connectivity.db.databaseName"
130
                  name="%driverDBName"
131
                  value="pubs"
132
                  required="true"
133
                  visible="true"/>                             
134
            <property
135
                  generated="false"
136
                  id="org.eclipse.datatools.connectivity.db.URL"
137
                  name="%driverConnectionURL"
138
                  value="jdbc:microsoft:sqlserver://localhost:1433;databaseName=pubs"
139
                  required="true"
140
                  visible="true"/>
141
            <property
142
                  generated="false"
143
                  id="org.eclipse.datatools.connectivity.db.username"
144
                  name="%driverUID"
145
                  value=""
146
                  required="false"
147
                  visible="true"/>
148
            <property
149
                  generated="false"
150
                  id="org.eclipse.datatools.connectivity.db.password"
151
                  name="%driverPWD"
152
                  required="false"
153
                  visible="true"/>
154
         </properties>
155
      </driverTemplate>
156
   </extension>
157
158
   <extension
159
         point="org.eclipse.datatools.connectivity.driverExtension">    
160
      <driverTemplate
161
            createDefault="false"
162
            emptyJarListIsOK="false"
163
            id="org.eclipse.datatools.enablement.msft.sqlserver.2005.other.driverTemplate"
164
            jarList=""
165
            name="%org.eclipse.datatools.enablement.msft.sqlserver.2005.other.driverTemplate"
166
            parentCategory="org.eclipse.datatools.enablement.msft.sqlserver.2005.driverCategory">
167
         <properties>
168
            <property
169
                  generated="false"
170
                  id="org.eclipse.datatools.connectivity.db.driverClass"
171
                  name="%driverClass"
172
                  value=""
173
                  required="true"
174
                  visible="true"/>
175
            <property
176
                  generated="false"
177
                  id="org.eclipse.datatools.connectivity.db.vendor"
178
                  name="%driverVendor"
179
                  value="SQL Server"
180
                  required="true"
181
                  visible="false"/>
182
            <property
183
                  generated="false"
184
                  id="org.eclipse.datatools.connectivity.db.version"
185
                  name="%driverVersion"
186
                  value="2005"
187
                  required="true"
188
                  visible="false"/>   
189
            <property
190
                  generated="false"
191
                  id="org.eclipse.datatools.connectivity.db.databaseName"
192
                  name="%driverDBName"
193
                  value=""
194
                  required="true"
195
                  visible="true"/>                             
196
            <property
197
                  generated="false"
198
                  id="org.eclipse.datatools.connectivity.db.URL"
199
                  name="%driverConnectionURL"
200
                  value=""
201
                  required="true"
202
                  visible="true"/>
203
            <property
204
                  generated="false"
205
                  id="org.eclipse.datatools.connectivity.db.username"
206
                  name="%driverUID"
207
                  value=""
208
                  required="false"
209
                  visible="true"/>
210
            <property
211
                  generated="false"
212
                  id="org.eclipse.datatools.connectivity.db.password"
213
                  name="%driverPWD"
214
                  required="false"
215
                  visible="true"/>
216
         </properties>
217
      </driverTemplate>
218
   </extension>
219
   
220
   <extension
221
         point="org.eclipse.datatools.connectivity.driverExtension">    
222
      <driverTemplate
223
            createDefault="false"
224
            emptyJarListIsOK="false"
225
            id="org.eclipse.datatools.enablement.msft.sqlserver.2000.other.driverTemplate"
226
            jarList=""
227
            name="%org.eclipse.datatools.enablement.msft.sqlserver.2000.other.driverTemplate"
228
            parentCategory="org.eclipse.datatools.enablement.msft.sqlserver.2000.driverCategory">
229
         <properties>
230
            <property
231
                  generated="false"
232
                  id="org.eclipse.datatools.connectivity.db.driverClass"
233
                  name="%driverClass"
234
                  value=""
235
                  required="true"
236
                  visible="true"/>
237
            <property
238
                  generated="false"
239
                  id="org.eclipse.datatools.connectivity.db.vendor"
240
                  name="%driverVendor"
241
                  value="SQL Server"
242
                  required="true"
243
                  visible="false"/>
244
            <property
245
                  generated="false"
246
                  id="org.eclipse.datatools.connectivity.db.version"
247
                  name="%driverVersion"
248
                  value="2000"
249
                  required="true"
250
                  visible="false"/>   
251
            <property
252
                  generated="false"
253
                  id="org.eclipse.datatools.connectivity.db.databaseName"
254
                  name="%driverDBName"
255
                  value=""
256
                  required="true"
257
                  visible="true"/>                             
258
            <property
259
                  generated="false"
260
                  id="org.eclipse.datatools.connectivity.db.URL"
261
                  name="%driverConnectionURL"
262
                  value=""
263
                  required="true"
264
                  visible="true"/>
265
            <property
266
                  generated="false"
267
                  id="org.eclipse.datatools.connectivity.db.username"
268
                  name="%driverUID"
269
                  value=""
270
                  required="false"
271
                  visible="true"/>
272
            <property
273
                  generated="false"
274
                  id="org.eclipse.datatools.connectivity.db.password"
275
                  name="%driverPWD"
276
                  required="false"
277
                  visible="true"/>
278
         </properties>
279
      </driverTemplate>
280
   </extension>
281
 
282
  <extension
283
         point="org.eclipse.datatools.connectivity.sqm.core.catalog">
284
      <overrideLoader
285
            provider="org.eclipse.datatools.enablement.msft.internal.sqlserver.loaders.SQL2005SchemaLoader"
286
            eclass="org.eclipse.datatools.modelbase.sql.schema.Schema"
287
            product="SQL Server"
288
            version="2005"/>
289
     <overrideLoader
290
           eclass=" org.eclipse.datatools.modelbase.sql.routines.Routine"
291
           product="SQL Server"
292
           provider="org.eclipse.datatools.enablement.msft.internal.sqlserver.loaders.SQL2005RoutineLoader"
293
           version="2005"/>
294
     <overrideLoader
295
           eclass=" org.eclipse.datatools.modelbase.sql.routines.Routine"
296
           product="SQL Server"
297
           provider="org.eclipse.datatools.enablement.msft.internal.sqlserver.loaders.SQL2005RoutineLoader"
298
           version="2000"/>
299
  </extension> 
300
 </plugin>  
(-)src/org/eclipse/datatools/enablement/msft/internal/sqlserver/connection/JDBCSQLServerJDBCConnection.java (+21 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2007 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.datatools.enablement.msft.internal.sqlserver.connection;
12
13
import org.eclipse.datatools.connectivity.IConnectionProfile;
14
import org.eclipse.datatools.connectivity.db.generic.JDBCConnection;
15
16
public class JDBCSQLServerJDBCConnection extends JDBCConnection {
17
18
	public JDBCSQLServerJDBCConnection(IConnectionProfile profile, Class factoryClass) {
19
		super(profile, factoryClass);
20
	}
21
}
(-)src/org/eclipse/datatools/enablement/msft/internal/sqlserver/connection/ISQLServerConnectionProfileConstants.java (+18 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2007 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.datatools.enablement.msft.internal.sqlserver.connection;
12
13
14
public interface ISQLServerConnectionProfileConstants {
15
16
	public static final String SQLSERVER_CATEGORY_ID = "org.eclipse.datatools.enablement.msft.sqlserver.driverCategory"; //$NON-NLS-1$
17
18
}
(-)icons/jdbc_16.gif (+3 lines)
Added Link Here
1
GIF89a³€ŸŸŸ¿ÜÛÀ¿À­®­€€¿¿¿ßß¿ÿßßîîî`_`_`_öööÑÑÑÿÿÿ!ù,sÐIֈ½?I™l ‚ƒ•HD0€‚È!Fè²$0ê
2
Â
3
?P(x?ä±($ƒÁá…gÅÓpÅ¢ÉD*‰×aA?FÁi@vÛý†Ç³ròÌD­¡RTp2<_u`'‡G‘?”•–;
(-)META-INF/MANIFEST.MF (-3 / +17 lines)
Lines 1-5 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
Bundle-ManifestVersion: 2
2
Bundle-ManifestVersion: 2
3
Bundle-Name: Ui Plug-in
3
Bundle-Name: %pluginName
4
Bundle-SymbolicName: org.eclipse.datatools.enablement.msft.sqlserver.ui
4
Bundle-SymbolicName: org.eclipse.datatools.enablement.msft.sqlserver.ui;singleton:=true
5
Bundle-Version: 1.0.0
5
Bundle-Version: 1.0.1.200710051
6
Bundle-Vendor: %providerName
7
Bundle-Localization: plugin
8
Require-Bundle: org.eclipse.core.runtime,
9
 org.eclipse.datatools.modelbase.sql;bundle-version="[1.0.0,2.0.0)",
10
 org.eclipse.datatools.connectivity.sqm.core;bundle-version="[1.0.1,2.0.0)",
11
 org.eclipse.ui;bundle-version="[3.2.0,4.0)",
12
 org.eclipse.datatools.connectivity;bundle-version="[1.0.1,2.0.0)",
13
 org.eclipse.datatools.connectivity.ui;bundle-version="[1.0.1,2.0.0)",
14
 org.eclipse.datatools.connectivity.db.generic;bundle-version="[1.0.0,2.0.0)",
15
 org.eclipse.datatools.connectivity.db.generic.ui;bundle-version="[1.0.1,2.0.0)",
16
 org.eclipse.datatools.enablement.msft.sqlserver;bundle-version="[1.0.1,2.0.0)"
17
Eclipse-LazyStart: true
18
Export-Package: org.eclipse.datatools.enablement.msft.sqlserver.internal.ui.connection
19
Bundle-RequiredExecutionEnvironment: J2SE-1.4
(-)src/org/eclipse/datatools/enablement/msft/sqlserver/internal/ui/connection/SQLServerDBProfileDetailsWizardPage.java (+23 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2007 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.datatools.enablement.msft.sqlserver.internal.ui.connection;
12
13
import org.eclipse.datatools.connectivity.db.generic.ui.GenericDBProfileDetailsWizardPage;
14
import org.eclipse.datatools.enablement.msft.internal.sqlserver.connection.ISQLServerConnectionProfileConstants;
15
16
public class SQLServerDBProfileDetailsWizardPage 
17
	extends GenericDBProfileDetailsWizardPage{
18
19
	public SQLServerDBProfileDetailsWizardPage(String pageName) {
20
		super(pageName);
21
		setDriverCategory(ISQLServerConnectionProfileConstants.SQLSERVER_CATEGORY_ID);	
22
	}
23
}
(-)plugin.properties (+15 lines)
Added Link Here
1
###############################################################################
2
# Copyright (c) 2006, 2007 IBM Corporation and others.
3
# All rights reserved. This program and the accompanying materials
4
# are made available under the terms of the Eclipse Public License v1.0
5
# which accompanies this distribution, and is available at
6
# http://www.eclipse.org/legal/epl-v10.html
7
# 
8
# Contributors:
9
#     IBM Corporation - initial API and implementation
10
###############################################################################
11
pluginName=Eclipse Data Tools Platform Microsoft SQL Server UI Plug-in
12
providerName=Eclipse.org
13
14
profile.sqlserver.wizard.title = SQL Server
15
profile.sqlserver.properties = SQL Server Connection Properties
(-)icons/new_db_element.gif (+4 lines)
Added Link Here
1
GIF89a÷ZcZcZc{„{„{„œœœ­­­µŒ9µ”9½½½½ÞÞÆ½ÆÖÖÖÞÞ½çΌÿÿÿÞÞÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ!ù,œt° €Áƒh?@‚‡$8A!C&ˆ8‘¢‹2näh „&
2
8 #LJJP¹rÀ–rPҀ?`D€€¢Ü
3
 ÀP	ˆàg͛-u²´i5èТG¥.]ÙôiTS«åš5çÖ±„"5Š”À€´$
4
Uª¼èeIpàÈ;
(-)src/org/eclipse/datatools/enablement/msft/sqlserver/internal/ui/connection/NewSQLServerConnectionProfileWizard.java (+59 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2007 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.datatools.enablement.msft.sqlserver.internal.ui.connection;
12
13
import java.util.Properties;
14
15
import org.eclipse.datatools.connectivity.ConnectionProfileConstants;
16
import org.eclipse.datatools.connectivity.db.generic.IDBConnectionProfileConstants;
17
import org.eclipse.datatools.connectivity.db.generic.IDBDriverDefinitionConstants;
18
import org.eclipse.datatools.connectivity.db.generic.ui.NewConnectionProfileWizard;
19
20
public class NewSQLServerConnectionProfileWizard extends NewConnectionProfileWizard {
21
22
	protected SQLServerDBProfileDetailsWizardPage mPropPage;
23
24
	public NewSQLServerConnectionProfileWizard() {
25
		super();
26
	}
27
28
	public void addCustomPages() {
29
		mPropPage = new SQLServerDBProfileDetailsWizardPage("detailsPage"); //$NON-NLS-1$
30
		addPage(mPropPage);
31
	}
32
	
33
	public Properties getProfileProperties() {
34
		Properties props = new Properties();
35
		props.setProperty(ConnectionProfileConstants.PROP_DRIVER_DEFINITION_ID,
36
				this.mPropPage.getDriverID());
37
		props.setProperty(
38
				IDBConnectionProfileConstants.CONNECTION_PROPERTIES_PROP_ID,
39
				this.mPropPage.getDBConnProps());
40
		props.setProperty(IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID, this.mPropPage
41
				.getDriverClass());
42
		props.setProperty(IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID, this.mPropPage
43
				.getVendor());		
44
		props.setProperty(IDBDriverDefinitionConstants.DATABASE_VERSION_PROP_ID, this.mPropPage
45
				.getVersion());			
46
		props.setProperty(IDBDriverDefinitionConstants.DATABASE_NAME_PROP_ID, this.mPropPage
47
				.getDatabaseName());
48
		props.setProperty(IDBDriverDefinitionConstants.PASSWORD_PROP_ID, this.mPropPage
49
				.getDBPWD());
50
		props.setProperty(
51
				IDBConnectionProfileConstants.SAVE_PASSWORD_PROP_ID, String
52
						.valueOf(this.mPropPage.getSaveDBPWD()));
53
		props.setProperty(IDBDriverDefinitionConstants.USERNAME_PROP_ID, this.mPropPage
54
				.getDBUID());
55
		props.setProperty(IDBDriverDefinitionConstants.URL_PROP_ID,
56
				this.mPropPage.getURL());
57
		return props;
58
	}
59
}
(-)src/org/eclipse/datatools/enablement/msft/sqlserver/internal/ui/connection/SQLServerDBProfilePropertyPage.java (+24 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2007 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.datatools.enablement.msft.sqlserver.internal.ui.connection;
12
13
import org.eclipse.datatools.connectivity.db.generic.ui.GenericDBProfilePropertyPage;
14
import org.eclipse.datatools.enablement.msft.internal.sqlserver.connection.ISQLServerConnectionProfileConstants;
15
16
public class SQLServerDBProfilePropertyPage extends GenericDBProfilePropertyPage {
17
18
	public SQLServerDBProfilePropertyPage() {
19
		super();
20
		noDefaultAndApplyButton();
21
		setDriverCategory(ISQLServerConnectionProfileConstants.SQLSERVER_CATEGORY_ID);	
22
	}
23
24
}
(-)plugin.xml (+26 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<?eclipse version="3.0"?>
3
<plugin>
4
	<extension
5
         point="org.eclipse.datatools.connectivity.connectionProfile">
6
      <newWizard
7
            class="org.eclipse.datatools.enablement.msft.sqlserver.internal.ui.connection.NewSQLServerConnectionProfileWizard"
8
            icon="icons/new_db_element.gif"
9
            id="org.eclipse.datatools.enablement.msft.sqlserver.NewSQLServerConnectionProfileWizard"
10
            name="%profile.sqlserver.wizard.title"
11
            profile="org.eclipse.datatools.enablement.msft.sqlserver.connectionProfile"/>
12
   </extension>
13
   <extension
14
         point="org.eclipse.ui.propertyPages">
15
      <page
16
            class="org.eclipse.datatools.enablement.msft.sqlserver.internal.ui.connection.SQLServerDBProfilePropertyPage"
17
            id="org.eclipse.datatools.enablement.msft.sqlserver.profileProperties"
18
            name="%profile.sqlserver.properties"
19
            objectClass="org.eclipse.datatools.connectivity.IConnectionProfile">
20
         <filter
21
               name="org.eclipse.datatools.profile.property.id"
22
               value="org.eclipse.datatools.enablement.msft.sqlserver.connectionProfile"/>
23
      </page>
24
   </extension>
25
   
26
 </plugin>  

Return to bug 203158