Revision 4186 trunk/libraries/libGDBMS/src/main/java/com/hardcode/gdbms/engine/data/DataSourceFactory.java
DataSourceFactory.java | ||
---|---|---|
13 | 13 |
import com.hardcode.driverManager.Driver; |
14 | 14 |
import com.hardcode.driverManager.DriverLoadException; |
15 | 15 |
import com.hardcode.driverManager.DriverManager; |
16 |
import com.hardcode.driverManager.WriterManager; |
|
16 | 17 |
import com.hardcode.gdbms.engine.data.db.DBDataSource; |
17 | 18 |
import com.hardcode.gdbms.engine.data.db.DBDataSourceFactory; |
18 | 19 |
import com.hardcode.gdbms.engine.data.db.DBQuerySourceInfo; |
... | ... | |
58 | 59 |
* createRandomDataSource. Adem?s proporciona un m?todo para ejecutar consultas |
59 | 60 |
* SQL a partir de la instrucci?n como cadena o a partir de la instrucci?n como |
60 | 61 |
* ?rbol de adaptadores |
61 |
*
|
|
62 |
* |
|
62 | 63 |
* @author Fernando Gonz?lez Cort?s |
63 | 64 |
*/ |
64 | 65 |
public class DataSourceFactory { |
... | ... | |
98 | 99 |
|
99 | 100 |
private File tempDir = new File("."); |
100 | 101 |
|
102 |
private WriterManager wm; |
|
103 |
|
|
101 | 104 |
/** |
102 | 105 |
* Get's a unique id in the tableSource and nameOperationDataSource key sets |
103 |
*
|
|
106 |
* |
|
104 | 107 |
* @return unique id |
105 | 108 |
*/ |
106 | 109 |
private String getUID() { |
... | ... | |
123 | 126 |
|
124 | 127 |
/** |
125 | 128 |
* Removes the association between the name and the data sources |
126 |
*
|
|
129 |
* |
|
127 | 130 |
* @param ds |
128 | 131 |
* Name of the data source to remove |
129 |
*
|
|
132 |
* |
|
130 | 133 |
* @throws DriverException |
131 | 134 |
* If ds is a database data source it's associated view must be |
132 | 135 |
* deleted. Thrown if could not be deleted. |
... | ... | |
146 | 149 |
|
147 | 150 |
/** |
148 | 151 |
* Removes de View of the data source 'ds' |
149 |
*
|
|
152 |
* |
|
150 | 153 |
* @param ds |
151 | 154 |
* DataSource whose view will be deleted |
152 |
*
|
|
155 |
* |
|
153 | 156 |
* @throws DriverException |
154 | 157 |
* If the view could not be deleted |
155 | 158 |
*/ |
... | ... | |
161 | 164 |
|
162 | 165 |
/** |
163 | 166 |
* Removes the views created at query delegation |
164 |
*
|
|
167 |
* |
|
165 | 168 |
* @throws DriverException |
166 | 169 |
* If any view could not be removed |
167 | 170 |
*/ |
... | ... | |
180 | 183 |
* A?ade una fuente de datos de objeto. Dado un objeto que implemente la |
181 | 184 |
* interfaz del driver, se toma como fuente de datos y se le asocia un |
182 | 185 |
* nombre |
183 |
*
|
|
186 |
* |
|
184 | 187 |
* @param rd |
185 | 188 |
* objeto con la informaci?n |
186 | 189 |
* @param name |
... | ... | |
196 | 199 |
* A?ade una fuente de datos de objeto. Dado un objeto que implemente la |
197 | 200 |
* interfaz del driver, se toma como fuente de datos y se le asocia un |
198 | 201 |
* nombre |
199 |
*
|
|
202 |
* |
|
200 | 203 |
* @param rd |
201 | 204 |
* objeto con la informaci?n |
202 |
*
|
|
205 |
* |
|
203 | 206 |
* @return the name of the data source |
204 | 207 |
*/ |
205 | 208 |
public String addDataSource(ObjectDriver rd) { |
... | ... | |
212 | 215 |
/** |
213 | 216 |
* Adds a new data source to the system. If the file doesn't exists it is |
214 | 217 |
* created when necessary |
215 |
*
|
|
218 |
* |
|
216 | 219 |
* @param driverName |
217 | 220 |
* Nombre del driver asociado a la fuente de datos |
218 | 221 |
* @param name |
... | ... | |
234 | 237 |
* A?ade un origen de datos de fichero al sistema. Cuando se cree un |
235 | 238 |
* DataSource mediante la invocaci?n createRandomDataSource(String) se |
236 | 239 |
* crear? una instancia del driver cuyo nombre es driverName |
237 |
*
|
|
240 |
* |
|
238 | 241 |
* @param driverName |
239 | 242 |
* Nombre del driver asociado a la fuente de datos |
240 | 243 |
* @param name |
... | ... | |
251 | 254 |
|
252 | 255 |
/** |
253 | 256 |
* Gets a FileSourceInfo with the values passed in the parameters |
254 |
*
|
|
257 |
* |
|
255 | 258 |
* @param driverName |
256 | 259 |
* @param name |
257 | 260 |
* @param file |
258 |
*
|
|
261 |
* |
|
259 | 262 |
* @return FileSourceInfo |
260 | 263 |
*/ |
261 | 264 |
private FileSourceInfo getFileSourceInfo(FileSourceInfo info, |
... | ... | |
270 | 273 |
|
271 | 274 |
/** |
272 | 275 |
* Adds a spatial file data source to the system. |
273 |
*
|
|
276 |
* |
|
274 | 277 |
* @param driverName |
275 | 278 |
* driver used to obtain the data |
276 | 279 |
* @param name |
... | ... | |
287 | 290 |
|
288 | 291 |
/** |
289 | 292 |
* Adds a spatial file data source to the system. |
290 |
*
|
|
293 |
* |
|
291 | 294 |
* @param driverName |
292 | 295 |
* driver used to obtain the data |
293 | 296 |
* @param file |
294 | 297 |
* file with the data |
295 |
*
|
|
298 |
* |
|
296 | 299 |
* @return String Generated name of the added data source |
297 | 300 |
*/ |
298 | 301 |
public String addSpatialFileDataSource(String driverName, String file) { |
... | ... | |
306 | 309 |
* A?ade un origen de datos de fichero al sistema. Cuando se cree un |
307 | 310 |
* DataSource mediante la invocaci?n createRandomDataSource(String) se |
308 | 311 |
* crear? una instancia del driver cuyo nombre es driverName |
309 |
*
|
|
312 |
* |
|
310 | 313 |
* @param driverName |
311 | 314 |
* Nombre del driver asociado a la fuente de datos |
312 | 315 |
* @param file |
313 | 316 |
* Fichero con los datos |
314 |
*
|
|
317 |
* |
|
315 | 318 |
* @return Nombre ?nico que se asocia a la tabla |
316 | 319 |
*/ |
317 | 320 |
public String addFileDataSource(String driverName, String file) { |
... | ... | |
324 | 327 |
/** |
325 | 328 |
* Obtiene la informaci?n de la fuente de datos cuyo nombre se pasa como |
326 | 329 |
* par?metro |
327 |
*
|
|
330 |
* |
|
328 | 331 |
* @param dataSourceName |
329 | 332 |
* Nombre de la base de datos |
330 |
*
|
|
333 |
* |
|
331 | 334 |
* @return Debido a las distintas formas en las que se puede registrar un |
332 | 335 |
* datasource, se devuelve un Object, que podr? ser una instancia de |
333 | 336 |
* DataSourceFactory.FileDriverInfo, DataSourceFactory.DBDriverInfo |
... | ... | |
339 | 342 |
|
340 | 343 |
/** |
341 | 344 |
* Gets the information of all data sources registered in the system |
342 |
*
|
|
345 |
* |
|
343 | 346 |
* @return DriverInfo[] |
344 | 347 |
*/ |
345 | 348 |
public SourceInfo[] getDriverInfos() { |
... | ... | |
356 | 359 |
|
357 | 360 |
/** |
358 | 361 |
* A?ade un origen de datos de base de datos al sistema |
359 |
*
|
|
362 |
* |
|
360 | 363 |
* @param name |
361 | 364 |
* Nombre de la tabla con el que se har? referencia en las |
362 | 365 |
* instrucciones |
... | ... | |
392 | 395 |
|
393 | 396 |
/** |
394 | 397 |
* Fills the info struct with the values passed in the parameters |
395 |
*
|
|
398 |
* |
|
396 | 399 |
* @param info |
397 | 400 |
* struct to populate |
398 | 401 |
* @param name |
... | ... | |
429 | 432 |
|
430 | 433 |
/** |
431 | 434 |
* Adds a spatial database data source |
432 |
*
|
|
435 |
* |
|
433 | 436 |
* @param name |
434 | 437 |
* Name of the data source |
435 | 438 |
* @param host |
... | ... | |
462 | 465 |
|
463 | 466 |
/** |
464 | 467 |
* Adds a spatial database data source |
465 |
*
|
|
468 |
* |
|
466 | 469 |
* @param host |
467 | 470 |
* host where the data is |
468 | 471 |
* @param port |
... | ... | |
479 | 482 |
* name of the field that has the geometry |
480 | 483 |
* @param driverInfo |
481 | 484 |
* name of the driver used to access the data |
482 |
*
|
|
485 |
* |
|
483 | 486 |
* @return generated name of the added data source |
484 | 487 |
*/ |
485 | 488 |
public String addSpatialDBDataSource(String host, int port, String user, |
... | ... | |
494 | 497 |
|
495 | 498 |
/** |
496 | 499 |
* A?ade un origen de datos de base de datos al sistema |
497 |
*
|
|
500 |
* |
|
498 | 501 |
* @param host |
499 | 502 |
* Cadena de conexi?n para conectar con el sgbd donde se |
500 | 503 |
* encuentra la tabla |
... | ... | |
514 | 517 |
* Informaci?n para saber qu? driver debe acceder a la |
515 | 518 |
* informaci?n. Se escoger? el driver cuyo valor de retorno del |
516 | 519 |
* m?todo getType coincida con este valor |
517 |
*
|
|
520 |
* |
|
518 | 521 |
* @return Nombre de la tabla con el que se har? referencia en las |
519 | 522 |
* instrucciones |
520 | 523 |
*/ |
... | ... | |
529 | 532 |
|
530 | 533 |
/** |
531 | 534 |
* A?ade un origen de datos de base de datos al sistema |
532 |
*
|
|
535 |
* |
|
533 | 536 |
* @param name |
534 | 537 |
* Nombre de la tabla con el que se har? referencia en las |
535 | 538 |
* instrucciones |
... | ... | |
572 | 575 |
|
573 | 576 |
/** |
574 | 577 |
* A?ade un origen de datos de base de datos al sistema |
575 |
*
|
|
578 |
* |
|
576 | 579 |
* @param host |
577 | 580 |
* Cadena de conexi?n para conectar con el sgbd donde se |
578 | 581 |
* encuentra la tabla |
... | ... | |
592 | 595 |
* Informaci?n para saber qu? driver debe acceder a la |
593 | 596 |
* informaci?n. Se escoger? el driver cuyo valor de retorno del |
594 | 597 |
* m?todo getType coincida con este valor |
595 |
*
|
|
598 |
* |
|
596 | 599 |
* @return Nombre de la tabla con el que se har? referencia en las |
597 | 600 |
* instrucciones |
598 | 601 |
*/ |
... | ... | |
608 | 611 |
/** |
609 | 612 |
* Cambia el nombre de una fuente de datos. Las consultas SQL que se |
610 | 613 |
* ejecuten con el nombre anterior fallar?n |
611 |
*
|
|
614 |
* |
|
612 | 615 |
* @param oldName |
613 | 616 |
* Nombre actual de la fuente de datos que se quiere cambiar |
614 | 617 |
* @param newName |
615 | 618 |
* Nombre que se le quiere poner a la fuente de datos |
616 |
*
|
|
619 |
* |
|
617 | 620 |
* @throws NoSuchTableException |
618 | 621 |
* Si no hay ninguna fuente de datos de nombre 'oldName' |
619 | 622 |
*/ |
... | ... | |
631 | 634 |
/** |
632 | 635 |
* Gets the data source passed by adding the AutomaticDataSource decorator |
633 | 636 |
* if factory mode is AUTOMATIC. |
634 |
*
|
|
637 |
* |
|
635 | 638 |
* @param ds |
636 | 639 |
* DataSource |
637 | 640 |
* @param mode |
638 | 641 |
* opening mode |
639 |
*
|
|
642 |
* |
|
640 | 643 |
* @return DataSource |
641 | 644 |
*/ |
642 | 645 |
private DataSource getModedDataSource(DataSource ds, int mode) { |
... | ... | |
651 | 654 |
* Sets the minimum delay between accesses needed to close the DataSource. |
652 | 655 |
* If accesses are delayed more than 'delay' the DataSource MAY be closed. |
653 | 656 |
* Only applies when the mode is set to AUTOMATIC_MODE |
654 |
*
|
|
657 |
* |
|
655 | 658 |
* @param delay |
656 | 659 |
* time un milliseconds |
657 | 660 |
*/ |
... | ... | |
663 | 666 |
* Dado el nombre de una tabla, se busca la fuente de datos asociada a dicha |
664 | 667 |
* tabla y se obtiene un datasource adecuado en funcion del tipo de fuente |
665 | 668 |
* de datos accediendo al subsistema de drivers |
666 |
*
|
|
669 |
* |
|
667 | 670 |
* @param tableName |
668 | 671 |
* Nombre de la fuente de datos |
669 |
*
|
|
672 |
* |
|
670 | 673 |
* @return DataSource que accede a dicha fuente |
671 |
*
|
|
674 |
* |
|
672 | 675 |
* @throws DriverLoadException |
673 | 676 |
* @throws NoSuchTableException |
674 | 677 |
* @throws DriverException |
... | ... | |
682 | 685 |
* Dado el nombre de una tabla, se busca la fuente de datos asociada a dicha |
683 | 686 |
* tabla y se obtiene un datasource adecuado en funcion del tipo de fuente |
684 | 687 |
* de datos accediendo al subsistema de drivers |
685 |
*
|
|
688 |
* |
|
686 | 689 |
* @param tableName |
687 | 690 |
* Nombre de la fuente de datos |
688 | 691 |
* @param mode |
... | ... | |
690 | 693 |
* automatically and closes after a while. It can be closed |
691 | 694 |
* manually. MANUAL_OPENING -> the DataSource opens and closes |
692 | 695 |
* manually |
693 |
*
|
|
696 |
* |
|
694 | 697 |
* @return DataSource que accede a dicha fuente |
695 |
*
|
|
698 |
* |
|
696 | 699 |
* @throws DriverLoadException |
697 | 700 |
* @throws NoSuchTableException |
698 | 701 |
* @throws DriverException |
... | ... | |
707 | 710 |
* tabla y se obtiene un datasource adecuado en funcion del tipo de fuente |
708 | 711 |
* de datos accediendo al subsistema de drivers. Se utiliza internamente |
709 | 712 |
* como nombre del DataSource el alias que se pasa como par?metro |
710 |
*
|
|
713 |
* |
|
711 | 714 |
* @param tableName |
712 | 715 |
* Nombre de la fuente de datos |
713 | 716 |
* @param tableAlias |
714 | 717 |
* Alias que tiene el DataSource en una instrucci?n |
715 |
*
|
|
718 |
* |
|
716 | 719 |
* @return DataSource que accede a dicha fuente de datos si la fuente de |
717 | 720 |
* datos es alfanum?rica o SpatialDataSource si la fuente de datos |
718 | 721 |
* es espacial |
719 |
*
|
|
722 |
* |
|
720 | 723 |
* @throws NoSuchTableException |
721 | 724 |
* Si no hay una fuente de datos registrada con ese nombre |
722 | 725 |
* @throws DriverLoadException |
... | ... | |
737 | 740 |
* tabla y se obtiene un datasource adecuado en funcion del tipo de fuente |
738 | 741 |
* de datos accediendo al subsistema de drivers. Se utiliza internamente |
739 | 742 |
* como nombre del DataSource el alias que se pasa como par?metro |
740 |
*
|
|
743 |
* |
|
741 | 744 |
* @param tableName |
742 | 745 |
* Nombre de la fuente de datos |
743 | 746 |
* @param tableAlias |
744 | 747 |
* Alias que tiene el DataSource en una instrucci?n |
745 | 748 |
* @param mode |
746 | 749 |
* openning mode |
747 |
*
|
|
750 |
* |
|
748 | 751 |
* @return DataSource que accede a dicha fuente de datos si la fuente de |
749 | 752 |
* datos es alfanum?rica o SpatialDataSource si la fuente de datos |
750 | 753 |
* es espacial |
751 |
*
|
|
754 |
* |
|
752 | 755 |
* @throws NoSuchTableException |
753 | 756 |
* Si no hay una fuente de datos registrada con ese nombre |
754 | 757 |
* @throws DriverLoadException |
... | ... | |
859 | 862 |
|
860 | 863 |
/** |
861 | 864 |
* Creates a DataSource from a memento object with the manual opening mode |
862 |
*
|
|
865 |
* |
|
863 | 866 |
* @param m |
864 | 867 |
* memento |
865 |
*
|
|
868 |
* |
|
866 | 869 |
* @return DataSource |
867 |
*
|
|
870 |
* |
|
868 | 871 |
* @throws RuntimeException |
869 | 872 |
* If the DataSource class cannot be instatiated |
870 | 873 |
*/ |
... | ... | |
875 | 878 |
/** |
876 | 879 |
* Creates a DataSource from a memento object with the specified opening |
877 | 880 |
* mode |
878 |
*
|
|
881 |
* |
|
879 | 882 |
* @param m |
880 | 883 |
* memento |
881 | 884 |
* @param mode |
882 | 885 |
* opening mode |
883 |
*
|
|
886 |
* |
|
884 | 887 |
* @return DataSource |
885 |
*
|
|
888 |
* |
|
886 | 889 |
* @throws RuntimeException |
887 | 890 |
* If the DataSource class cannot be instatiated |
888 | 891 |
*/ |
... | ... | |
932 | 935 |
/** |
933 | 936 |
* Devuelve true si todas las tablas provienen del mismo data base |
934 | 937 |
* management system |
935 |
*
|
|
938 |
* |
|
936 | 939 |
* @param tables |
937 | 940 |
* Array de tablas |
938 |
*
|
|
941 |
* |
|
939 | 942 |
* @return boolean |
940 | 943 |
*/ |
941 | 944 |
private boolean sameDBMS(DataSource[] tables) { |
... | ... | |
961 | 964 |
/** |
962 | 965 |
* A partir de una instrucci?n select se encarga de obtener el DataSource |
963 | 966 |
* resultado de la ejecuci?n de dicha instrucci?n |
964 |
*
|
|
967 |
* |
|
965 | 968 |
* @param instr |
966 | 969 |
* Instrucci?n select origen del datasource |
967 | 970 |
* @param mode |
968 | 971 |
* opening mode |
969 |
*
|
|
972 |
* |
|
970 | 973 |
* @return DataSource que accede a los datos resultado de ejecutar la select |
971 |
*
|
|
974 |
* |
|
972 | 975 |
* @throws DriverLoadException |
973 | 976 |
* @throws DriverException |
974 | 977 |
* Si fallo la lectura de la fuente de datos por parte del |
... | ... | |
990 | 993 |
/** |
991 | 994 |
* Creates a view in the database management system that hosts the data |
992 | 995 |
* source 'dbds'. The view is defined by the sql parameter |
993 |
*
|
|
996 |
* |
|
994 | 997 |
* @param dbds |
995 | 998 |
* DataSource used to execute the query |
996 | 999 |
* @param sql |
997 | 1000 |
* The SQL query defining the view |
998 |
*
|
|
1001 |
* |
|
999 | 1002 |
* @return Name of the view |
1000 |
*
|
|
1003 |
* |
|
1001 | 1004 |
* @throws DriverException |
1002 | 1005 |
* If the view cannot be created |
1003 | 1006 |
*/ |
... | ... | |
1029 | 1032 |
/** |
1030 | 1033 |
* Gets a DataSource implementation with the sql instruction as the data |
1031 | 1034 |
* source by creating a view in the underlaying datasource management system |
1032 |
*
|
|
1035 |
* |
|
1033 | 1036 |
* @param sql |
1034 | 1037 |
* Instruction definig the data source |
1035 | 1038 |
* @param driver |
1036 | 1039 |
* Driver used to access the data source |
1037 | 1040 |
* @param dbInfo |
1038 | 1041 |
* data source info |
1039 |
*
|
|
1042 |
* |
|
1040 | 1043 |
* @return DataSource |
1041 |
*
|
|
1044 |
* |
|
1042 | 1045 |
* @throws DriverException |
1043 | 1046 |
* If cannot create the view |
1044 | 1047 |
*/ |
... | ... | |
1073 | 1076 |
/** |
1074 | 1077 |
* A partir de una instrucci?n select se encarga de obtener el DataSource |
1075 | 1078 |
* resultado de la ejecuci?n de dicha instrucci?n |
1076 |
*
|
|
1079 |
* |
|
1077 | 1080 |
* @param instr |
1078 | 1081 |
* Instrucci?n select origen del datasource |
1079 |
*
|
|
1082 |
* |
|
1080 | 1083 |
* @return DataSource que accede a los datos resultado de ejecutar la select |
1081 |
*
|
|
1084 |
* |
|
1082 | 1085 |
* @throws DriverException |
1083 | 1086 |
* @throws SemanticException |
1084 | 1087 |
* @throws IOException |
... | ... | |
1130 | 1133 |
/** |
1131 | 1134 |
* Translates the table references by changind the gdbms name with the |
1132 | 1135 |
* underlaying database management system table name |
1133 |
*
|
|
1136 |
* |
|
1134 | 1137 |
* @param instr |
1135 | 1138 |
* root of the adapted tree |
1136 | 1139 |
* @param tables |
1137 | 1140 |
* DataSources involved in the instruction |
1138 |
*
|
|
1141 |
* |
|
1139 | 1142 |
* @return The translated sql query |
1140 |
*
|
|
1143 |
* |
|
1141 | 1144 |
* @throws DriverException |
1142 | 1145 |
* If driver access fails |
1143 | 1146 |
* @throws SemanticException |
... | ... | |
1155 | 1158 |
|
1156 | 1159 |
/** |
1157 | 1160 |
* Gets the name of the table where the field is in |
1158 |
*
|
|
1161 |
* |
|
1159 | 1162 |
* @param fieldName |
1160 | 1163 |
* field whose table wants to be guessed |
1161 | 1164 |
* @param tables |
1162 | 1165 |
* tables involved in the search |
1163 |
*
|
|
1166 |
* |
|
1164 | 1167 |
* @return table name |
1165 |
*
|
|
1168 |
* |
|
1166 | 1169 |
* @throws DriverException |
1167 | 1170 |
* If driver access fails |
1168 | 1171 |
* @throws SemanticException |
... | ... | |
1197 | 1200 |
/** |
1198 | 1201 |
* Translates the table references by changind the gdbms name with the |
1199 | 1202 |
* underlaying database management system table name |
1200 |
*
|
|
1203 |
* |
|
1201 | 1204 |
* @param adapter |
1202 | 1205 |
* adapter processed |
1203 | 1206 |
* @param instrNameDBName |
... | ... | |
1205 | 1208 |
* as the values. |
1206 | 1209 |
* @param tables |
1207 | 1210 |
* tables involved in the instruction |
1208 |
*
|
|
1211 |
* |
|
1209 | 1212 |
* @throws DriverException |
1210 | 1213 |
* If driver access fails |
1211 | 1214 |
* @throws SemanticException |
... | ... | |
1237 | 1240 |
/** |
1238 | 1241 |
* Translates the table references by changind the gdbms name with the |
1239 | 1242 |
* underlaying database management system table name |
1240 |
*
|
|
1243 |
* |
|
1241 | 1244 |
* @param adapter |
1242 | 1245 |
* adapter processed |
1243 | 1246 |
* @param instrNameDBName |
... | ... | |
1271 | 1274 |
|
1272 | 1275 |
/** |
1273 | 1276 |
* Obtiene el DataSource resultado de ejecutar la instrucci?n de union |
1274 |
*
|
|
1277 |
* |
|
1275 | 1278 |
* @param instr |
1276 | 1279 |
* instrucci?n de union |
1277 | 1280 |
* @param mode |
1278 | 1281 |
* opening mode |
1279 |
*
|
|
1282 |
* |
|
1280 | 1283 |
* @return DataSource |
1281 |
*
|
|
1284 |
* |
|
1282 | 1285 |
* @throws DriverException |
1283 | 1286 |
* Si fallo la lectura de la fuente de datos por parte del |
1284 | 1287 |
* driver |
... | ... | |
1300 | 1303 |
|
1301 | 1304 |
/** |
1302 | 1305 |
* Obtiene el DataSource resultado de ejecutar la instrucci?n de union |
1303 |
*
|
|
1306 |
* |
|
1304 | 1307 |
* @param instr |
1305 | 1308 |
* instrucci?n de union |
1306 |
*
|
|
1309 |
* |
|
1307 | 1310 |
* @return DataSource |
1308 |
*
|
|
1311 |
* |
|
1309 | 1312 |
* @throws DriverException |
1310 | 1313 |
* Si fallo la lectura de la fuente de datos por parte del |
1311 | 1314 |
* driver |
... | ... | |
1340 | 1343 |
|
1341 | 1344 |
/** |
1342 | 1345 |
* Creates a DataSource as a result of a custom query |
1343 |
*
|
|
1346 |
* |
|
1344 | 1347 |
* @param instr |
1345 | 1348 |
* Root node of the adapter tree of the custom query instruction |
1346 | 1349 |
* @param mode |
1347 | 1350 |
* opening mode |
1348 |
*
|
|
1351 |
* |
|
1349 | 1352 |
* @return DataSource with the custom query result |
1350 |
*
|
|
1353 |
* |
|
1351 | 1354 |
* @throws SemanticException |
1352 | 1355 |
* if there is any semantic error in the instruction |
1353 | 1356 |
*/ |
... | ... | |
1358 | 1361 |
|
1359 | 1362 |
/** |
1360 | 1363 |
* Creates a DataSource as a result of a custom query |
1361 |
*
|
|
1364 |
* |
|
1362 | 1365 |
* @param instr |
1363 | 1366 |
* Root node of the adapter tree of the custom query instruction |
1364 |
*
|
|
1367 |
* |
|
1365 | 1368 |
* @return DataSource with the custom query result |
1366 |
*
|
|
1369 |
* |
|
1367 | 1370 |
* @throws SemanticException |
1368 | 1371 |
* if there is any semantic error in the instruction |
1369 | 1372 |
*/ |
... | ... | |
1382 | 1385 |
/** |
1383 | 1386 |
* Ejecuta la instrucci?n SQL que se pasa como par?metro obteniendo un |
1384 | 1387 |
* DataSource con el resultado de la ejecuci?n |
1385 |
*
|
|
1388 |
* |
|
1386 | 1389 |
* @param sql |
1387 | 1390 |
* instrucci?n sql que se quiere ejecutar |
1388 | 1391 |
* @param mode |
1389 | 1392 |
* opening mode |
1390 |
*
|
|
1393 |
* |
|
1391 | 1394 |
* @return DataSource con el resultado |
1392 |
*
|
|
1395 |
* |
|
1393 | 1396 |
* @throws ParseException |
1394 | 1397 |
* Si se produce un error de parse de la instrucci?n |
1395 | 1398 |
* @throws DriverLoadException |
... | ... | |
1441 | 1444 |
/** |
1442 | 1445 |
* Establece el DriverManager que se usar? para instanciar DataSource's. |
1443 | 1446 |
* Este metodo debe ser invocado antes que ning?n otro |
1444 |
*
|
|
1447 |
* |
|
1445 | 1448 |
* @param dm |
1446 | 1449 |
* El manager que se encarga de cargar los drivers |
1447 | 1450 |
*/ |
1448 | 1451 |
public void setDriverManager(DriverManager dm) { |
1449 | 1452 |
this.dm = dm; |
1450 | 1453 |
} |
1451 |
|
|
1452 | 1454 |
/** |
1455 |
* Establece el WriterManager que se usar? para instanciar DataSource's. |
|
1456 |
* Este metodo debe ser invocado antes que ning?n otro |
|
1457 |
* |
|
1458 |
* @param dm |
|
1459 |
* El manager que se encarga de cargar los drivers |
|
1460 |
*/ |
|
1461 |
public void setWriterManager(WriterManager wm) { |
|
1462 |
this.wm = wm; |
|
1463 |
} |
|
1464 |
/** |
|
1453 | 1465 |
* Get's the module with the specified name |
1454 |
*
|
|
1466 |
* |
|
1455 | 1467 |
* @param name |
1456 | 1468 |
* name of the wanted module |
1457 |
*
|
|
1469 |
* |
|
1458 | 1470 |
* @return instance of the module |
1459 | 1471 |
*/ |
1460 | 1472 |
public Object getModule(String name) { |
... | ... | |
1463 | 1475 |
|
1464 | 1476 |
/** |
1465 | 1477 |
* Registers a module in the system with the specified name |
1466 |
*
|
|
1478 |
* |
|
1467 | 1479 |
* @param name |
1468 | 1480 |
* name of the module |
1469 | 1481 |
* @param instance |
... | ... | |
1475 | 1487 |
|
1476 | 1488 |
/** |
1477 | 1489 |
* Gets a driver manager reference |
1478 |
*
|
|
1490 |
* |
|
1479 | 1491 |
* @return DriverManagers. |
1480 | 1492 |
*/ |
1481 | 1493 |
public DriverManager getDriverManager() { |
1482 | 1494 |
return dm; |
1483 | 1495 |
} |
1484 |
|
|
1485 | 1496 |
/** |
1497 |
* Gets a writer manager reference |
|
1498 |
* |
|
1499 |
* @return WriterManagers. |
|
1500 |
*/ |
|
1501 |
public WriterManager getWriterManager() { |
|
1502 |
return wm; |
|
1503 |
} |
|
1504 |
/** |
|
1486 | 1505 |
* Sets if this factory will check for delegating instructions at the server |
1487 | 1506 |
* (true) or will execute all queries internally (false). By delegating at |
1488 | 1507 |
* the server, lots of queries will be defined in the database management |
1489 | 1508 |
* system where the execution is delegated. Invoke clearViews to remove all |
1490 | 1509 |
* created views. |
1491 |
*
|
|
1510 |
* |
|
1492 | 1511 |
* @param b |
1493 | 1512 |
*/ |
1494 | 1513 |
public void setDelegating(boolean b) { |
... | ... | |
1497 | 1516 |
|
1498 | 1517 |
/** |
1499 | 1518 |
* Creates a new table on the specified database |
1500 |
*
|
|
1519 |
* |
|
1501 | 1520 |
* @param database |
1502 | 1521 |
* name of the database where the table will be created |
1503 | 1522 |
* @param pkNames |
... | ... | |
1506 | 1525 |
* names of the fields |
1507 | 1526 |
* @param types |
1508 | 1527 |
* types of the fields. Must have the same length than names |
1509 |
*
|
|
1528 |
* |
|
1510 | 1529 |
* @return the table name |
1511 |
*
|
|
1530 |
* |
|
1512 | 1531 |
* @throws SQLException |
1513 | 1532 |
* if the creation fails |
1514 | 1533 |
*/ |
... | ... | |
1526 | 1545 |
|
1527 | 1546 |
/** |
1528 | 1547 |
* Frees all resources used during execution |
1529 |
*
|
|
1548 |
* |
|
1530 | 1549 |
* @throws SQLException |
1531 | 1550 |
* If cannot free internal resources |
1532 | 1551 |
* @throws DriverException |
... | ... | |
1545 | 1564 |
|
1546 | 1565 |
/** |
1547 | 1566 |
* Initializes the system. |
1548 |
*
|
|
1567 |
* |
|
1549 | 1568 |
* @throws InitializationException |
1550 | 1569 |
* If the initialization |
1551 | 1570 |
*/ |
... | ... | |
1555 | 1574 |
|
1556 | 1575 |
/** |
1557 | 1576 |
* Initializes the system |
1558 |
*
|
|
1577 |
* |
|
1559 | 1578 |
* @param tempDir |
1560 | 1579 |
* temporary directory to write data |
1561 |
*
|
|
1580 |
* |
|
1562 | 1581 |
* @throws InitializationException |
1563 | 1582 |
* If the initialization fails |
1564 | 1583 |
*/ |
... | ... | |
1579 | 1598 |
/** |
1580 | 1599 |
* Gets the URL of a file in the temporary directory. Does not creates any |
1581 | 1600 |
* file |
1582 |
*
|
|
1601 |
* |
|
1583 | 1602 |
* @return String |
1584 | 1603 |
*/ |
1585 | 1604 |
public String getTempFile() { |
... | ... | |
1598 | 1617 |
|
1599 | 1618 |
/** |
1600 | 1619 |
* Crea un nuevo ServerViewInfo. |
1601 |
*
|
|
1620 |
* |
|
1602 | 1621 |
* @param ds |
1603 | 1622 |
* DOCUMENT ME! |
1604 | 1623 |
* @param name |
Also available in: Unified diff