1 package org.webdocwf.util.loader; 2 3 27 28 import java.io.*; 29 import java.util.*; 30 31 import javax.xml.parsers.*; 32 33 import org.w3c.dom.*; 34 import org.webdocwf.util.loader.logging.*; 35 36 42 public class JdbcParametersElement { 43 44 private String strJDBCSourceParameterDriver = ""; 45 private String strJDBCTargetParameterDriver = ""; 46 private String strJDBCSourceParameterConnection = ""; 47 private String strJDBCTargetParameterConnection = ""; 48 private String strJDBCSourceParameterUser = ""; 49 private String strJDBCTargetParameterUser = ""; 50 private String strJDBCSourceParameterPassword = ""; 51 private String strJDBCTargetParameterPassword = ""; 52 53 private String strJDBCDefaultSourceParameterDriver = ""; 54 private String strJDBCDefaultTargetParameterDriver = ""; 55 private String strJDBCDefaultSourceParameterConnection = ""; 56 private String strJDBCDefaultTargetParameterConnection = ""; 57 private String strJDBCDefaultSourceParameterUser = ""; 58 private String strJDBCDefaultTargetParameterUser = ""; 59 private String strJDBCDefaultSourceParameterPassword = ""; 60 private String strJDBCDefaultTargetParameterPassword = ""; 61 62 private String strDbVendor = ""; 63 private String strDriverName = ""; 64 65 private String strTargetDbVendor = ""; 66 private String strTargetDriverName = ""; 67 68 private String strDbVendorDefault = ""; 69 private String strDriverNameDefault = ""; 70 71 private String strTargetDbVendorDefault = ""; 72 private String strTargetDriverNameDefault = ""; 73 74 private Logger logger; 75 private Vector targetConnections; 76 77 private String loaderJobFile=""; 78 private ConfigReader configReaderSource; 79 80 81 86 public void parseTargetJDBCParameters(InputStream inStream) throws LoaderException{ 87 Document doc = null; 88 targetConnections=new Vector(); 89 try { 90 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); 91 DocumentBuilder db = null; 92 db = dbf.newDocumentBuilder(); 93 doc = db.parse(inStream); 94 } catch (Exception e) { 95 this.logger.write("normal", "Sorry, an error occurred: " + e); 96 LoaderException le = new LoaderException("Exception: ", 97 (Throwable )e); 98 throw le; 99 } 100 if (doc != null) { 101 NodeList targetList = doc.getElementsByTagName( "jdbcTargetParameters" ); 102 int position=0; 103 if(targetList.getLength()!=0){ 104 for(int i=0;i<targetList.getLength();i++){ 105 106 targetConnections.add(position,""); 107 targetConnections.add(position+1,""); 108 targetConnections.add(position+2,""); 109 targetConnections.add(position+3,""); 110 111 NodeList childs=targetList.item(i).getChildNodes(); 112 for(int k=0;k<childs.getLength();k++){ 113 if(childs.item(k).getNodeType()==3){ 114 }else{ 116 NamedNodeMap attributes= childs.item(k).getAttributes(); 117 String name=attributes.getNamedItem("name").getNodeValue(); 118 if(name.equalsIgnoreCase("JdbcDriver")) 119 targetConnections.set(position,attributes.getNamedItem("value").getNodeValue()); 120 else if(name.equalsIgnoreCase("Connection.Url")){ 121 targetConnections.set(position+1,attributes.getNamedItem("value").getNodeValue()); 122 }else if(name.equalsIgnoreCase("User")) 123 targetConnections.set(position+2,attributes.getNamedItem("value").getNodeValue()); 124 else if(name.equalsIgnoreCase("Password")) 125 targetConnections.set(position+3,attributes.getNamedItem("value").getNodeValue()); 126 127 } 128 } 129 position=position+4; 130 } 131 } 132 } 133 try { 134 inStream.reset(); 135 } catch (IOException e) { 136 this.logger.write("normal", "Sorry, an error occurred: " + e); 137 LoaderException le = new LoaderException("IOException: ",(Throwable )e); 138 throw le; 139 } 140 } 141 142 146 public Vector getTargetConnections(){ 147 return targetConnections; 148 } 149 150 158 public void parseImportJDBCParameters (InputStream inStream,int number,String tagName) throws LoaderException{ 159 this.strJDBCSourceParameterDriver = ""; 160 this.strJDBCTargetParameterDriver = ""; 161 this.strJDBCSourceParameterConnection = ""; 162 this.strJDBCTargetParameterConnection = ""; 163 this.strJDBCSourceParameterUser = ""; 164 this.strJDBCTargetParameterUser = ""; 165 this.strJDBCSourceParameterPassword = ""; 166 this.strJDBCTargetParameterPassword = ""; 167 this.strDbVendor = ""; 168 this.strDriverName = ""; 169 this.strTargetDbVendor = ""; 170 this.strTargetDriverName = ""; 171 number--; 172 Document doc = null; 173 Vector vecJDBCTargetValue = new Vector(); 174 Vector vecJDBCTargetName = new Vector(); 175 Vector vecJDBCSourceValue = new Vector(); 176 Vector vecJDBCSourceName = new Vector(); 177 boolean isOK = false; 178 179 this.logger.write("full", "\tparseImportJDBCParameters method is started."); 180 try { 181 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); 182 DocumentBuilder db = null; 183 db = dbf.newDocumentBuilder(); 184 doc = db.parse(inStream); 185 } catch (Exception e) { 186 this.logger.write("normal", "Sorry, an error occurred: " + e); 187 LoaderException le = new LoaderException("Exception: ", 188 (Throwable )e); 189 throw le; 190 } 192 if (doc != null) { 193 NodeList tagDefault = doc.getElementsByTagName( tagName ); 194 if (tagDefault.getLength() != 0) { 195 Element docFragment = (Element)tagDefault.item( number ); 196 NodeList tag = docFragment.getElementsByTagName("jdbcSourceParameters"); 198 if (tag.getLength() != 0) { 199 NamedNodeMap jdbc = tag.item(0).getAttributes(); 200 Node nodeJdbc = jdbc.getNamedItem("dbVendor"); 201 if (nodeJdbc != null) 202 this.strDbVendor = nodeJdbc.getNodeValue(); 203 nodeJdbc = jdbc.getNamedItem("driverName"); 204 if (nodeJdbc != null) 205 this.strDriverName = nodeJdbc.getNodeValue(); 206 } 207 tag = docFragment.getElementsByTagName("jdbcTargetParameters"); 209 if (tag.getLength() != 0) { 210 NamedNodeMap jdbc = tag.item(0).getAttributes(); 211 Node nodeJdbc = jdbc.getNamedItem("dbVendor"); 212 if (nodeJdbc != null) 213 this.strTargetDbVendor = nodeJdbc.getNodeValue(); 214 nodeJdbc = jdbc.getNamedItem("driverName"); 215 if (nodeJdbc != null) 216 this.strTargetDriverName = nodeJdbc.getNodeValue(); 217 } 218 219 tag = docFragment.getElementsByTagName("jdbcSourceParameter"); 220 for (int i = 0; i < tag.getLength(); i++) { 221 String nodeValueValue = ""; 222 String nodeNameValue = ""; 223 NamedNodeMap attrs = tag.item(i).getAttributes(); 224 Node nodeValue = attrs.getNamedItem("value"); 225 Node nodeName = attrs.getNamedItem("name"); 226 if (nodeValue != null && nodeName != null) { 227 nodeValueValue = nodeValue.getNodeValue(); 228 nodeNameValue = nodeName.getNodeValue(); 229 } 230 vecJDBCSourceValue.addElement(nodeValueValue); 231 vecJDBCSourceName.addElement(nodeNameValue); 232 } 233 for (int i = 0; i < vecJDBCSourceValue.size(); i++) { 234 if (vecJDBCSourceName.get(i).toString().equalsIgnoreCase("JdbcDriver")) 235 this.strJDBCSourceParameterDriver = vecJDBCSourceValue.get(i).toString(); 236 else if (vecJDBCSourceName.get(i).toString().equalsIgnoreCase("Connection.Url")) { 237 if(vecJDBCSourceValue.get(i).toString().indexOf("jdbc:microsoft:sqlserver")!=-1) { 239 if(vecJDBCSourceValue.get(i).toString().indexOf("SelectMethod")==-1) { 240 this.strJDBCSourceParameterConnection = vecJDBCSourceValue.get(i).toString()+";SelectMethod=cursor"; 241 } else { 242 if(vecJDBCSourceValue.get(i).toString().indexOf("cursor")!=-1) { 243 this.strJDBCSourceParameterConnection = vecJDBCSourceValue.get(i).toString(); 244 } else { 245 this.logger.write("normal", "Sorry, an error occurred: value of Connection.Url perameter SelectMethod has to be cursor" ); 246 LoaderException le = new LoaderException("Exception:", new Exception ("value of Connection.Url perameter SelectMethod has to be cursor")); 247 throw le; 248 } 249 } 250 } else { 251 this.strJDBCSourceParameterConnection = vecJDBCSourceValue.get(i).toString(); 252 } 253 } 254 else if (vecJDBCSourceName.get(i).toString().equalsIgnoreCase("User")) 255 this.strJDBCSourceParameterUser = vecJDBCSourceValue.get(i).toString(); 256 else if (vecJDBCSourceName.get(i).toString().equalsIgnoreCase("Password")) 257 this.strJDBCSourceParameterPassword = vecJDBCSourceValue.get(i).toString(); 258 } 259 tag = docFragment.getElementsByTagName("jdbcTargetParameter"); 260 for (int i = 0; i < tag.getLength(); i++) { 261 String nodeValueValue = ""; 262 String nodeNameValue = ""; 263 NamedNodeMap attrs = tag.item(i).getAttributes(); 264 Node nodeValue = attrs.getNamedItem("value"); 265 Node nodeName = attrs.getNamedItem("name"); 266 if (nodeValueValue != null && nodeName != null) { 267 nodeValueValue = nodeValue.getNodeValue(); 268 nodeNameValue = nodeName.getNodeValue(); 269 } 270 vecJDBCTargetValue.addElement(nodeValueValue); 271 vecJDBCTargetName.addElement(nodeNameValue); 272 } 273 for (int i = 0; i < vecJDBCTargetValue.size(); i++) { 274 if (vecJDBCTargetName.get(i).toString().equalsIgnoreCase("JdbcDriver")) 275 this.strJDBCTargetParameterDriver = vecJDBCTargetValue.get(i).toString(); 276 else if (vecJDBCTargetName.get(i).toString().equalsIgnoreCase("Connection.Url")) { 277 if(vecJDBCTargetValue.get(i).toString().indexOf("jdbc:microsoft:sqlserver")!=-1) { 279 if(vecJDBCTargetValue.get(i).toString().indexOf("SelectMethod")==-1) { 280 this.strJDBCTargetParameterConnection = vecJDBCTargetValue.get(i).toString()+";SelectMethod=cursor"; 281 } else { 282 if(vecJDBCTargetValue.get(i).toString().indexOf("cursor")!=-1) { 283 this.strJDBCTargetParameterConnection = vecJDBCTargetValue.get(i).toString(); 284 } else { 285 this.logger.write("normal", "Sorry, an error occurred: value of Connection.Url perameter SelectMethod has to be cursor" ); 286 LoaderException le = new LoaderException("Exception:", new Exception ("value of Connection.Url perameter SelectMethod has to be cursor")); 287 throw le; 288 } 289 } 290 } else { 291 this.strJDBCTargetParameterConnection = vecJDBCTargetValue.get(i).toString(); 292 } 293 } 294 else if (vecJDBCTargetName.get(i).toString().equalsIgnoreCase("User")) 295 this.strJDBCTargetParameterUser = vecJDBCTargetValue.get(i).toString(); 296 else if (vecJDBCTargetName.get(i).toString().equalsIgnoreCase("Password")) 297 this.strJDBCTargetParameterPassword = vecJDBCTargetValue.get(i).toString(); 298 } 299 } 300 isOK=true; 301 } 302 try { 303 inStream.reset(); 304 } catch (IOException e) { 305 this.logger.write("normal", "Sorry, an error occurred: " + e); 306 LoaderException le = new LoaderException("IOException: ", 307 (Throwable )e); 308 throw le; 309 } 310 this.logger.write("full", "\tparseImportJDBCDefaultParameters method is finished."); 311 } 312 313 314 321 public boolean parseImportJDBCDefaultParameters (InputStream inStream) throws LoaderException{ 322 Document doc = null; 323 Vector vecJDBCTargetValue = new Vector(); 324 Vector vecJDBCTargetName = new Vector(); 325 Vector vecJDBCSourceValue = new Vector(); 326 Vector vecJDBCSourceName = new Vector(); 327 boolean isOK = false; 328 329 this.logger.write("full", "\tparseImportJDBCDefaultParameters method is started."); 330 try { 331 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); 332 DocumentBuilder db = null; 333 db = dbf.newDocumentBuilder(); 334 doc = db.parse(inStream); 335 } catch (Exception e) { 336 this.logger.write("normal", "Sorry, an error occurred: " + e); 337 LoaderException le = new LoaderException("Exception: ", 338 (Throwable )e); 339 throw le; 340 } 341 if (doc != null) { 342 NodeList tagDefault = doc.getElementsByTagName("jdbcDefaultParameters"); 343 if (tagDefault.getLength() != 0) { 344 Element docFragment = (Element)tagDefault.item(0); 345 NodeList tag = docFragment.getElementsByTagName("jdbcSourceParameters"); 346 if (tag.getLength() != 0) { 347 NamedNodeMap jdbc = tag.item(0).getAttributes(); 348 Node nodeJdbc = jdbc.getNamedItem("dbVendor"); 349 if (nodeJdbc != null) 350 this.strDbVendorDefault = nodeJdbc.getNodeValue(); 351 nodeJdbc = jdbc.getNamedItem("driverName"); 352 if (nodeJdbc != null) 353 this.strDriverNameDefault = nodeJdbc.getNodeValue(); 354 } 355 tag = docFragment.getElementsByTagName("jdbcTargetParameters"); 356 if (tag.getLength() != 0) { 357 NamedNodeMap jdbc = tag.item(0).getAttributes(); 358 Node nodeJdbc = jdbc.getNamedItem("dbVendor"); 359 if (nodeJdbc != null) 360 this.strTargetDbVendorDefault = nodeJdbc.getNodeValue(); 361 nodeJdbc = jdbc.getNamedItem("driverName"); 362 if (nodeJdbc != null) 363 this.strTargetDriverNameDefault = nodeJdbc.getNodeValue(); 364 } 365 tag = docFragment.getElementsByTagName("jdbcSourceParameter"); 366 for (int i = 0; i < tag.getLength(); i++) { 367 String nodeValueValue = ""; 368 String nodeNameValue = ""; 369 NamedNodeMap attrs = tag.item(i).getAttributes(); 370 Node nodeValue = attrs.getNamedItem("value"); 371 Node nodeName = attrs.getNamedItem("name"); 372 if (nodeValue != null && nodeName != null) { 373 nodeValueValue = nodeValue.getNodeValue(); 374 nodeNameValue = nodeName.getNodeValue(); 375 } 376 vecJDBCSourceValue.addElement(nodeValueValue); 377 vecJDBCSourceName.addElement(nodeNameValue); 378 } 379 for (int i = 0; i < vecJDBCSourceValue.size(); i++) { 380 if (vecJDBCSourceName.get(i).toString().equalsIgnoreCase("JdbcDriver")) 381 this.strJDBCDefaultSourceParameterDriver = vecJDBCSourceValue.get(i).toString(); 382 else if (vecJDBCSourceName.get(i).toString().equalsIgnoreCase("Connection.Url")) { 383 if(vecJDBCSourceValue.get(i).toString().indexOf("jdbc:microsoft:sqlserver")!=-1) { 385 if(vecJDBCSourceValue.get(i).toString().indexOf("SelectMethod")==-1) { 386 this.strJDBCDefaultSourceParameterConnection = vecJDBCSourceValue.get(i).toString()+";SelectMethod=cursor"; 387 } else { 388 if(vecJDBCSourceValue.get(i).toString().indexOf("cursor")!=-1) { 389 this.strJDBCDefaultSourceParameterConnection = vecJDBCSourceValue.get(i).toString(); 390 } else { 391 this.logger.write("normal", "Sorry, an error occurred: value of Connection.Url perameter SelectMethod has to be cursor" ); 392 LoaderException le = new LoaderException("Exception:", new Exception ("value of Connection.Url perameter SelectMethod has to be cursor")); 393 throw le; 394 } 395 } 396 } else { 397 this.strJDBCDefaultSourceParameterConnection = vecJDBCSourceValue.get(i).toString(); 398 } 399 } 400 else if (vecJDBCSourceName.get(i).toString().equalsIgnoreCase("User")) 401 this.strJDBCDefaultSourceParameterUser = vecJDBCSourceValue.get(i).toString(); 402 else if (vecJDBCSourceName.get(i).toString().equalsIgnoreCase("Password")) 403 this.strJDBCDefaultSourceParameterPassword = vecJDBCSourceValue.get(i).toString(); 404 } 405 tag = docFragment.getElementsByTagName("jdbcTargetParameter"); 406 for (int i = 0; i < tag.getLength(); i++) { 407 String nodeValueValue = ""; 408 String nodeNameValue = ""; 409 NamedNodeMap attrs = tag.item(i).getAttributes(); 410 Node nodeValue = attrs.getNamedItem("value"); 411 Node nodeName = attrs.getNamedItem("name"); 412 if (nodeValueValue != null && nodeName != null) { 413 nodeValueValue = nodeValue.getNodeValue(); 414 nodeNameValue = nodeName.getNodeValue(); 415 } 416 vecJDBCTargetValue.addElement(nodeValueValue); 417 vecJDBCTargetName.addElement(nodeNameValue); 418 } 419 for (int i = 0; i < vecJDBCTargetValue.size(); i++) { 420 if (vecJDBCTargetName.get(i).toString().equalsIgnoreCase("JdbcDriver")) 421 this.strJDBCDefaultTargetParameterDriver = vecJDBCTargetValue.get(i).toString(); 422 else if (vecJDBCTargetName.get(i).toString().equalsIgnoreCase("Connection.Url")) { 423 if(vecJDBCTargetValue.get(i).toString().indexOf("jdbc:microsoft:sqlserver")!=-1) { 425 if(vecJDBCTargetValue.get(i).toString().indexOf("SelectMethod")==-1) { 426 this.strJDBCDefaultTargetParameterConnection = vecJDBCTargetValue.get(i).toString()+";SelectMethod=cursor"; 427 } else { 428 if(vecJDBCTargetValue.get(i).toString().indexOf("cursor")!=-1) { 429 this.strJDBCDefaultTargetParameterConnection = vecJDBCTargetValue.get(i).toString(); 430 } else { 431 this.logger.write("normal", "Sorry, an error occurred: value of Connection.Url perameter SelectMethod has to be cursor" ); 432 LoaderException le = new LoaderException("Exception:", new Exception ("value of Connection.Url perameter SelectMethod has to be cursor")); 433 throw le; 434 } 435 } 436 } else { 437 this.strJDBCDefaultTargetParameterConnection = vecJDBCTargetValue.get(i).toString(); 438 } 439 } 440 else if (vecJDBCTargetName.get(i).toString().equalsIgnoreCase("User")) 441 this.strJDBCDefaultTargetParameterUser = vecJDBCTargetValue.get(i).toString(); 442 else if (vecJDBCTargetName.get(i).toString().equalsIgnoreCase("Password")) 443 this.strJDBCDefaultTargetParameterPassword = vecJDBCTargetValue.get(i).toString(); 444 } 445 } 446 isOK=true; 447 } 448 try { 449 inStream.reset(); 450 } catch (IOException e) { 451 this.logger.write("normal", "Sorry, an error occurred: " + e); 452 LoaderException le = new LoaderException("IOException: ", 453 (Throwable )e); 454 throw le; 455 } 456 this.logger.write("full", "\tparseImportJDBCDefaultParameters method is finished."); 457 return isOK; 458 } 459 460 465 public void setLogger(Logger logger) { 466 this.logger = logger; 467 } 468 469 474 public void setConfigReaderSource(ConfigReader configReader) { 475 this.configReaderSource = configReader; 476 } 477 478 479 483 public void setLoaderJobPath(String loaderJobName){ 484 File file=new File(loaderJobName); 485 this.loaderJobFile=file.getAbsoluteFile().getParent()+System.getProperty("file.separator"); 486 } 487 488 494 public String getAbsolutePathFromDatabaseURL(String urlToDatabase) throws LoaderException{ 495 496 if(configReaderSource.getFileSystemDatabase()==true){ 497 String urlPrefix = configReaderSource.getConnectionPrefix(); 498 String pathToDatabase=urlToDatabase.substring(urlPrefix.length()); 499 File file=new File(pathToDatabase); 500 if (!file.isAbsolute()){ 501 pathToDatabase=this.loaderJobFile + pathToDatabase; 502 File absolutePath=new File(pathToDatabase); 503 try { 504 pathToDatabase=absolutePath.getCanonicalPath(); 505 } 506 catch (Exception ex) { 507 this.logger.write("normal", ex.getMessage()); 508 LoaderException le = new LoaderException("Exception: ",(Throwable )ex); 509 throw le; 510 } 511 urlToDatabase = urlToDatabase.substring(0, (urlPrefix.length())) + 512 pathToDatabase; 513 } 514 } 515 return urlToDatabase; 516 } 517 518 519 527 public String getJDBCSourceParameterConnection() throws LoaderException { 528 String parseUrl=""; 529 try{ 530 if (!this.strJDBCSourceParameterConnection.equals("")) { 531 parseUrl= getAbsolutePathFromDatabaseURL(this.strJDBCSourceParameterConnection); 532 } else { 533 parseUrl= getAbsolutePathFromDatabaseURL(this.strJDBCDefaultSourceParameterConnection); 534 } 535 }catch(LoaderException ex){ 536 throw ex; 537 } 538 return parseUrl; 539 } 540 541 545 public void setJDBCSourceParameterConnection(String arg) { 546 this.strJDBCSourceParameterConnection = arg; 547 } 548 549 private String getJDBCDefaultSourceParameterConnection() { 550 return this.strJDBCDefaultSourceParameterConnection; 551 } 552 553 559 public String getJDBCSourceParameterDriver() { 560 if( !this.strJDBCSourceParameterDriver.equals("") ) 561 return this.strJDBCSourceParameterDriver; 562 else 563 return this.strJDBCDefaultSourceParameterDriver; 564 } 565 566 570 public void setJDBCSourceParameterDriver(String arg) { 571 this.strJDBCSourceParameterDriver = arg; 572 } 573 574 private String getJDBCDefaultSourceParameterDriver() { 575 return this.strJDBCDefaultSourceParameterDriver; 576 } 577 578 584 public String getJDBCSourceParameterPassword() { 585 if( !this.strJDBCSourceParameterPassword.equals("") ) 586 return this.strJDBCSourceParameterPassword; 587 else 588 return this.strJDBCDefaultSourceParameterPassword; 589 } 590 591 595 public void setJDBCSourceParameterPassword(String arg) { 596 this.strJDBCSourceParameterPassword = arg; 597 } 598 599 private String getJDBCDefaultSourceParameterPassword() { 600 return this.strJDBCDefaultSourceParameterPassword; 601 } 602 603 609 public String getJDBCSourceParameterUser() { 610 if( !this.strJDBCSourceParameterUser.equals("") ) 611 return this.strJDBCSourceParameterUser; 612 else 613 return this.strJDBCDefaultSourceParameterUser; 614 } 615 616 620 public void setJDBCSourceParameterUser(String arg) { 621 this.strJDBCSourceParameterUser = arg; 622 } 623 624 private String getJDBCDefaultSourceParameterUser() { 625 return this.strJDBCDefaultSourceParameterUser; 626 } 627 628 629 636 public String getJDBCTargetParameterConnection() { 637 if( !this.strJDBCTargetParameterConnection.equals("") ) 638 return this.strJDBCTargetParameterConnection; 639 else 640 return this.strJDBCDefaultTargetParameterConnection; 641 } 642 643 647 public void setJDBCTargetParameterConnection(String arg) { 648 this.strJDBCTargetParameterConnection = arg; 649 } 650 651 private String getJDBCDefaultTargetParameterConnection() { 652 return this.strJDBCDefaultTargetParameterConnection; 653 } 654 655 661 public String getJDBCTargetParameterDriver() { 662 if( !this.strJDBCTargetParameterDriver.equals("") ) 663 return this.strJDBCTargetParameterDriver; 664 else 665 return this.strJDBCDefaultTargetParameterDriver; 666 } 667 668 672 public void setJDBCTargetParameterDriver(String arg) { 673 this.strJDBCTargetParameterDriver = arg; 674 } 675 676 private String getJDBCDefaultTargetParameterDriver() { 677 return this.strJDBCDefaultTargetParameterDriver; 678 } 679 680 686 public String getJDBCTargetParameterPassword() { 687 if( !this.strJDBCTargetParameterPassword.equals("") ) 688 return this.strJDBCTargetParameterPassword; 689 else 690 return this.strJDBCDefaultTargetParameterPassword; 691 } 692 693 697 public void setJDBCTargetParameterPassword(String arg) { 698 this.strJDBCTargetParameterPassword = arg; 699 } 700 701 private String getJDBCDefaultTargetParameterPassword() { 702 return this.strJDBCDefaultTargetParameterPassword; 703 } 704 705 711 public String getJDBCTargetParameterUser() { 712 if( !this.strJDBCTargetParameterUser.equals("") ) 713 return this.strJDBCTargetParameterUser; 714 else 715 return this.strJDBCDefaultTargetParameterUser; 716 } 717 718 722 public void setJDBCTargetParameterUser(String arg) { 723 this.strJDBCTargetParameterUser = arg; 724 } 725 726 private String getJDBCDefaultTargetParameterUser() { 727 return this.strJDBCDefaultTargetParameterUser; 728 } 729 730 private String getDBVendorDefault() { 731 return this.strDbVendorDefault; 732 } 733 734 private String getDriverNameDefault() { 735 return this.strDriverNameDefault; 736 } 737 738 private String getTargetDbVendorDefault() { 739 return this.strTargetDbVendorDefault; 740 } 741 742 private String getTargetDriverNameDefault() { 743 return this.strTargetDriverNameDefault; 744 } 745 746 752 public String getTargetDBVendor() { 753 if( !this.strTargetDbVendor.equals("") ) 754 return this.strTargetDbVendor; 755 else 756 return this.strTargetDbVendorDefault; 757 } 758 759 765 public String getTargetDriverName() { 766 if( !this.strTargetDriverName.equals("") ) 767 return this.strTargetDriverName; 768 else{ 769 if(this.strTargetDbVendor.equalsIgnoreCase("")&&this.strTargetDriverName.equalsIgnoreCase("")){ 770 return this.strTargetDriverNameDefault; 771 }else 772 return ""; 773 } 774 } 775 776 782 public String getDriverName() { 783 if( !this.strDriverName.equals("") ) 784 return this.strDriverName; 785 else{ 786 if(this.strDbVendor.equalsIgnoreCase("")&&this.strDriverName.equalsIgnoreCase("")){ 787 return this.strDriverNameDefault; 788 }else 789 return ""; 790 } 791 } 792 793 799 public String getDbVendor() { 800 if( !this.strDbVendor.equals("") ) 801 return this.strDbVendor; 802 else 803 return this.strDbVendorDefault; 804 } 805 806 } | Popular Tags |