Changeset 3952
- Timestamp:
- 27/05/08 16:34:13 (13 years ago)
- Location:
- TI01-discovery/branches/ws-Discovery2-upgrade/src/ndg/services/discovery
- Files:
-
- 2 added
- 2 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
TI01-discovery/branches/ws-Discovery2-upgrade/src/ndg/services/discovery/PostgresDBClient.java
r3950 r3952 10 10 * 11 11 */ 12 public class DBClient12 public class PostgresDBClient implements InterfaceDBClient 13 13 { 14 14 // Obtain a suitable logger. 15 private static Logger logger = Logger.getLogger( DBClient.class.getName());15 private static Logger logger = Logger.getLogger(PostgresDBClient.class.getName()); 16 16 17 17 Connection db; // A connection to the database … … 30 30 * @param userName 31 31 * @param pw 32 * @throws SQLException 33 * @throws DiscoveryWSException 32 * @throws DiscoveryDBException 34 33 */ 35 public DBClient(String connectionString, String userName, String pw) throws SQLException, DiscoveryWSException34 public PostgresDBClient(String connectionString, String userName, String pw) throws DiscoveryDBException 36 35 { 37 36 this.userName = userName; 38 37 this.pw = pw; 39 init(connectionString);38 setupConnection(connectionString); 40 39 } 41 40 … … 50 49 * @param portNo 51 50 * @throws SQLException 52 * @throws Discovery WSException51 * @throws DiscoveryDBException 53 52 */ 54 public DBClient(String db, String userName, String pw, String host, int portNo)55 throws SQLException, DiscoveryWSException53 public PostgresDBClient(String db, String userName, String pw, String host, int portNo) 54 throws DiscoveryDBException 56 55 { 57 56 this.userName = userName; 58 57 this.pw = pw; 59 58 String connectionString = "jdbc:postgresql://" + host + ":" + portNo + "/" + db; 60 init(connectionString);59 setupConnection(connectionString); 61 60 } 62 61 63 /** 64 * Initialise db connection - including loading the driver library 65 * 66 * @param connectionString - connection string to connect to the DB with 67 * 62 /* (non-Javadoc) 63 * @see ndg.services.discovery.InterfaceDBClient#setupConnection(java.lang.String) 68 64 */ 69 p rivate void init(String connectionString) throws DiscoveryWSException, SQLException65 public void setupConnection(String connectionString) throws DiscoveryDBException 70 66 { 71 67 logger.info("Initialising DB client set up"); … … 81 77 "postgresql-...jdbc4.jar is available on the classpath."; 82 78 logger.severe(errorMessage); 83 throw new Discovery WSException(errorMessage);79 throw new DiscoveryDBException(errorMessage); 84 80 } 85 81 86 logger.info("Setting up connection to DB"); 87 db = DriverManager.getConnection(connectionString, this.userName, this.pw); 88 dbmd = db.getMetaData(); //get MetaData to confirm connection 89 logger.info("Connection to "+dbmd.getDatabaseProductName()+" "+ 90 dbmd.getDatabaseProductVersion()+" successful.\n"); 91 92 93 //create a statement that we can use later 94 logger.info("Creating sql statement to use for running queries with later"); 95 sql = db.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY); 82 try 83 { 84 logger.info("Setting up connection to DB"); 85 db = DriverManager.getConnection(connectionString, this.userName, this.pw); 86 dbmd = db.getMetaData(); //get MetaData to confirm connection 87 logger.info("Connection to "+dbmd.getDatabaseProductName()+" "+ 88 dbmd.getDatabaseProductVersion()+" successful.\n"); 89 90 91 //create a statement that we can use later 92 logger.info("Creating sql statement to use for running queries with later"); 93 sql = db.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY); 94 95 } 96 catch (SQLException e) 97 { 98 handleSQLException(e); 99 } 96 100 logger.info("Initialising complete"); 97 101 } 98 102 99 /** 100 * Run a specified SQL query against the client DB connection 101 * @param sqlQuery 102 * @return 103 * @throws SQLException 103 /* (non-Javadoc) 104 * @see ndg.services.discovery.InterfaceDBClient#runQuery(java.lang.String) 104 105 */ 105 public String[][] runQuery(String sqlQuery) throws SQLException106 public String[][] runQuery(String sqlQuery) throws DiscoveryDBException 106 107 { 107 108 logger.info("Executing the command: " + sqlQuery); 108 ResultSet results = sql.executeQuery(sqlQuery);109 109 String[][] returnData = null; 110 if (results != null) 110 111 try 111 112 { 112 logger.info("Retrieving results data..."); 113 int colCount = results.getMetaData().getColumnCount(); 114 logger.fine("Returning " + colCount + " columns of data"); 115 116 // finding the row count is less easy 117 // - firstly point to the last row in resultset. 118 results.last(); 113 ResultSet results = sql.executeQuery(sqlQuery); 114 if (results != null) 115 { 116 logger.info("Retrieving results data..."); 117 int colCount = results.getMetaData().getColumnCount(); 118 logger.fine("Returning " + colCount + " columns of data"); 119 120 // finding the row count is less easy 121 // - firstly point to the last row in resultset. 122 results.last(); 119 123 120 // Now get the row position which is also the number of rows in the resultset.121 int rowcount = results.getRow();124 // Now get the row position which is also the number of rows in the resultset. 125 int rowcount = results.getRow(); 122 126 123 // Now reposition back at the beginning of the ResultSet 124 results.beforeFirst(); 125 126 returnData = new String[rowcount][colCount]; 127 int i = 0; 128 while (results.next()) 129 { 130 for (int j = 0; j < colCount; j++) 131 { 132 returnData[i][j] = results.getString(j+1); 133 System.out.println(returnData[i][j]); 134 } 135 127 // Now reposition back at the beginning of the ResultSet 128 results.beforeFirst(); 129 130 returnData = new String[rowcount][colCount]; 131 int i = 0; 132 while (results.next()) 133 { 134 for (int j = 0; j < colCount; j++) 135 { 136 returnData[i][j] = results.getString(j+1); 137 System.out.println(returnData[i][j]); 138 } 139 140 } 136 141 } 137 } 138 results.close(); 142 results.close(); 143 } 144 catch (SQLException e) 145 { 146 handleSQLException(e); 147 } 139 148 return returnData; 140 149 } 150 151 152 /** 153 * Handle any SQLExceptions thrown by the JDBC library in a uniform way 154 * - logging and wrappering detail in Discovery framework code 155 * 156 * @param e - exception thrown 157 * @throws DiscoveryDBException 158 */ 159 private void handleSQLException(SQLException e) throws DiscoveryDBException 160 { 161 String errorMessage = 162 "SQLException thrown whilst interacting with postgres DB - detail: " + 163 e.getLocalizedMessage(); 164 logger.severe(errorMessage); 165 throw new DiscoveryDBException(errorMessage); 166 } 167 168 /* (non-Javadoc) 169 * @see ndg.services.discovery.InterfaceDBClient#closeConnection() 170 */ 171 public void closeConnection() throws DiscoveryDBException 172 { 173 logger.info("Closing DB connection..."); 174 try 175 { 176 db.close(); 177 } 178 catch (SQLException e) 179 { 180 handleSQLException(e); 181 } 182 logger.info("DB connection closed"); 141 183 } 142 184 … … 145 187 try 146 188 { 147 DBClient demo = newDBClient("jdbc:postgresql://glue:51000/calum", "calum", "boybear");189 InterfaceDBClient demo = new PostgresDBClient("jdbc:postgresql://glue:51000/calum", "calum", "boybear"); 148 190 demo.runQuery("SELECT * FROM ORIGINAL_DOCUMENT"); 149 191 } -
TI01-discovery/branches/ws-Discovery2-upgrade/src/ndg/services/discovery/SearchAgent.java
r3950 r3952 8 8 import java.math.BigDecimal; // needed because xmlbeans uses this for xsd:decimal 9 9 import java.util.Calendar; // needed because xmlbeans uses this for xsd:date 10 import java.util.logging.Logger; 10 11 import java.io.ByteArrayInputStream; 11 12 import java.text.DecimalFormat; … … 23 24 * @author Matt Pritchard <m.j.pritchard@rl.ac.uk> 24 25 */ 25 public abstract class SearchAgent { 26 public abstract class SearchAgent 27 { 28 29 private static Logger logger = Logger.getLogger(SearchAgent.class.getName()); 26 30 27 31 static Properties properties = new ServiceProperties().getProperties(); … … 55 59 Calendar dateRangeEnd; 56 60 57 // Output parameters58 boolean status;59 String statusMessage;60 61 int hits; 61 62 Hashtable result = new Hashtable(); … … 294 295 * @return SearchSummary object containing result of search 295 296 */ 296 public SearchSummary doSearch() { 297 public SearchSummary doSearch() 298 { 297 299 298 300 SearchSummary result = new SearchSummary(); … … 300 302 try 301 303 { 302 // Set xmlDbURI as class variable so can reuse it in error messages 303 String uri = properties.getProperty("xmlrpc.uri"); 304 305 // Create xmlrpc client & set username, password 306 XmlRpcClient xmlrpc = new XmlRpcClient( uri ); 307 xmlrpc.setBasicAuthentication(properties.getProperty("xmlrpc.username"),properties.getProperty("xmlrpc.password")); 308 309 310 //1. Prepare & execute the search 311 Vector queryParams = new Vector(); 304 // firstly prepare the search query string 305 String sqlQuery = constructSearchQuery(); 312 306 313 StringBuffer sqlCmd = new StringBuffer("SELECT original_document_id FROM ORIGINAL DOCUMENT WHERE "); 314 315 // Substitute values in template xquery string 307 // now run the query using the db client configured appropriately 308 InterfaceDBClient client = setupDBClient(); 309 client.runQuery(sqlQuery); 310 311 312 // ByteArrayInputStream resultStream = new ByteArrayInputStream( resultByteArray ); 313 // 314 // // Mark the beginning of the Stream, so can reset before each xpath evaluation (!) 315 // resultStream.mark( resultStream.available() ); 316 // InputSource resultSource = new InputSource( resultStream ); 317 // 318 // XPath xpath = XPathFactory.newInstance().newXPath(); 319 // String hitsExpr = "/exist:result/@hits"; 320 // String documentExpr = "//exist:result/document"; 321 // xpath.setNamespaceContext( new existNamespaceContextImpl() ); 322 // 323 // // If there is a successful search but with no hits, exist sets hitCount=0 rather than hits=0 !! 324 // // Need to check that the thing returned by xpath will convert to an int 325 // try 326 // { 327 // int xpathHits = (new Integer( xpath.evaluate(hitsExpr, resultSource) )).intValue(); 328 // result.setHits( xpathHits ); 329 // } 330 // catch (NumberFormatException e) 331 // { 332 // result.setHits( 0 ); 333 // } 334 // 335 // resultStream.reset(); 336 // NodeList nodeList = (NodeList)xpath.evaluate( documentExpr, resultSource, XPathConstants.NODESET ); 337 // 338 // if ( result.getHits() > 0) 339 // { 340 // Vector documents = new Vector(); 341 // for (int i=0; i<nodeList.getLength(); i++) 342 // { 343 // Hashtable thisDoc = new Hashtable(); 344 // thisDoc.put("name", nodeList.item(i).getFirstChild().getNodeValue() ); 345 // thisDoc.put("matches", 1); 346 // thisDoc.put("position", i); 347 // documents.add( thisDoc ); 348 // } 349 // result.setStatus( true ); 350 // result.setStatusMessage( "Success" ); 351 // result.setDocuments( documents ); 352 // } 353 // else 354 // { 355 // result.setStatus( false ); 356 // result.setStatusMessage("Search was successful but generated no results."); 357 // } 358 // 359 360 } 361 catch (Exception e) 362 { 363 result.setStatus(false); 364 result.setStatusMessage("An error ocurred - details : " + e.toString()); 365 } 366 367 return result; 368 } 369 370 /** 371 * Set up a DBClient object to use with running the search - getting the config details 372 * from the properties file 373 * 374 * @return DBClient ready to accept SQL queries to run 375 * @throws DiscoveryDBException 376 */ 377 private InterfaceDBClient setupDBClient() throws DiscoveryDBException 378 { 379 logger.info("Setting up DBClient using config info from properties file..."); 380 String connectionString = properties.getProperty("jdbc.uri"); 381 String userName = properties.getProperty("jdbc.username"); 382 String pw = properties.getProperty("jdbc.password"); 383 384 InterfaceDBClient client = new PostgresDBClient(connectionString, userName, pw); 385 logger.info("DBClient set up for use with Discovery service."); 386 return client; 387 } 388 389 private String constructSearchQuery() 390 { 391 //1. Prepare & execute the search 392 Vector queryParams = new Vector(); 393 394 StringBuffer sqlCmd = new StringBuffer("SELECT original_document_id FROM ORIGINAL DOCUMENT WHERE "); 395 396 // Substitute values in template xquery string 316 397 /* xqueryStr = xqueryStr.replaceFirst("__subst_term__", this.term); 317 318 319 320 321 322 323 398 xqueryStr = xqueryStr.replaceFirst("__subst_scope__", this.getScopesAsString() ); 399 400 // orderByField contains $ chars etc so needs special treatment to avoid "java.lang.IllegalArgumentException: Illegal group reference" when replacing 401 String orderByFieldReplace = Matcher.quoteReplacement(this.orderByField); 402 xqueryStr = xqueryStr.replaceAll("__subst_orderByField__", orderByFieldReplace); //NB replaceAll cos more than 1! 403 xqueryStr = xqueryStr.replaceFirst("__subst_orderByDirection__", this.orderByDirection); 404 324 405 */ // Construct the search clause for spatio temporal search, if necessary 325 String spatialClause = ""; 326 try 406 String spatialClause = ""; 407 try 408 { 409 SPATIO: 410 if ( 411 doSpatio && 412 limitWest != null && 413 limitSouth != null && 414 limitNorth != null && 415 limitEast != null 416 ) 327 417 { 328 SPATIO: 329 if ( 330 doSpatio && 331 limitWest != null && 332 limitSouth != null && 333 limitNorth != null && 334 limitEast != null 418 if ( // Ignore spatial search if search area is global 419 limitWest.intValue() == -180 && 420 limitEast.intValue() == 180 && 421 limitNorth.intValue() == 90 && 422 limitSouth.intValue() == -90 335 423 ) 336 424 { 337 if ( // Ignore spatial search if search area is global 338 limitWest.intValue() == -180 && 339 limitEast.intValue() == 180 && 340 limitNorth.intValue() == 90 && 341 limitSouth.intValue() == -90 342 ) 343 { 344 doSpatio = false; 345 System.out.println("Global extent selected : spatial search ignored"); 346 break SPATIO; 347 } 348 349 String latFormatPattern = "#0.00"; 350 String lonFormatPattern = "##0.00"; 351 DecimalFormat latFormat = new DecimalFormat( latFormatPattern ); 352 DecimalFormat lonFormat = new DecimalFormat( lonFormatPattern ); 353 354 if ( spatialOperator.equals("within") ) 355 { 356 spatialClause += " sbox_contains_box("; 357 } 358 else if ( spatialOperator.equals("overlaps") ) 359 { 360 spatialClause += " sbox_overlap_box("; 361 } 362 else if ( spatialOperator.equals("doesNotOverlap") ) 363 { 364 spatialClause += " NOT sbox_overlap_box("; 365 } 366 else 367 { 368 doSpatio = false; 369 throw new Exception("Unrecognised spatial operator: " + spatialOperator + " (see spatialOperatorList for supported values)"); 370 } 371 spatialClause += " sbox'("+ 372 lonFormat.format( limitWest.floatValue() )+"d,"+ 373 latFormat.format( limitSouth.floatValue() )+"d),("+ 374 lonFormat.format( limitEast.floatValue() )+"d,"+ 375 latFormat.format( limitNorth.floatValue() )+"d)' "; 376 spatialClause += ", coordinates ) "; 377 425 doSpatio = false; 426 System.out.println("Global extent selected : spatial search ignored"); 427 break SPATIO; 378 428 } 379 else { 380 doSpatio = false; //just in case any components of coordinates were null 429 430 String latFormatPattern = "#0.00"; 431 String lonFormatPattern = "##0.00"; 432 DecimalFormat latFormat = new DecimalFormat( latFormatPattern ); 433 DecimalFormat lonFormat = new DecimalFormat( lonFormatPattern ); 434 435 if ( spatialOperator.equals("within") ) 436 { 437 spatialClause += " sbox_contains_box("; 438 } 439 else if ( spatialOperator.equals("overlaps") ) 440 { 441 spatialClause += " sbox_overlap_box("; 381 442 } 382 } 383 catch (Exception e) 384 { 385 System.out.println("Error converting coordinates to SQL: " + e.toString() ); 386 doSpatio = false; 387 } 388 389 String temporalClause = ""; 390 try 391 { 392 if ( 393 doTemporal && 394 dateRangeStart != null && 395 dateRangeEnd != null && 396 dateRangeEnd.getTimeInMillis() > dateRangeStart.getTimeInMillis() 397 ) 443 else if ( spatialOperator.equals("doesNotOverlap") ) 398 444 { 399 String format = "yyyy-MM-dd"; 400 SimpleDateFormat sdf = new SimpleDateFormat(format); 401 402 temporalClause = " (startdate, enddate) OVERLAPS (DATE '"+sdf.format( dateRangeStart.getTime() )+"', DATE '"+ sdf.format( dateRangeEnd.getTime() ) +"') "; 403 } 445 spatialClause += " NOT sbox_overlap_box("; 446 } 404 447 else 405 448 { 406 doTemporal = false; // just in case any components of date range were null 407 } 449 doSpatio = false; 450 throw new Exception("Unrecognised spatial operator: " + spatialOperator + " (see spatialOperatorList for supported values)"); 451 } 452 spatialClause += " sbox'("+ 453 lonFormat.format( limitWest.floatValue() )+"d,"+ 454 latFormat.format( limitSouth.floatValue() )+"d),("+ 455 lonFormat.format( limitEast.floatValue() )+"d,"+ 456 latFormat.format( limitNorth.floatValue() )+"d)' "; 457 spatialClause += ", coordinates ) "; 458 408 459 } 409 catch (Exception e) 460 else { 461 doSpatio = false; //just in case any components of coordinates were null 462 } 463 } 464 catch (Exception e) 465 { 466 System.out.println("Error converting coordinates to SQL: " + e.toString() ); 467 doSpatio = false; 468 } 469 470 String temporalClause = ""; 471 try 472 { 473 if ( 474 doTemporal && 475 dateRangeStart != null && 476 dateRangeEnd != null && 477 dateRangeEnd.getTimeInMillis() > dateRangeStart.getTimeInMillis() 478 ) 410 479 { 411 System.out.println("Error converting date to SQL: " + e.toString() ); 412 temporalClause = ""; 413 doTemporal = false; 414 } 415 416 String whereClause = ""; 417 if ( doSpatio && doTemporal ) 418 { 419 whereClause = " WHERE " + spatialClause + " AND " + temporalClause + " "; 420 } 421 else if ( doSpatio && !doTemporal ) 422 { 423 whereClause = " WHERE " + spatialClause + " "; 424 } 425 else if ( doTemporal && !doSpatio ) 426 { 427 whereClause = " WHERE " + temporalClause + " "; 480 String format = "yyyy-MM-dd"; 481 SimpleDateFormat sdf = new SimpleDateFormat(format); 482 483 temporalClause = " (startdate, enddate) OVERLAPS (DATE '"+sdf.format( dateRangeStart.getTime() )+"', DATE '"+ sdf.format( dateRangeEnd.getTime() ) +"') "; 428 484 } 429 485 else 430 486 { 431 whereClause = "";487 doTemporal = false; // just in case any components of date range were null 432 488 } 489 } 490 catch (Exception e) 491 { 492 System.out.println("Error converting date to SQL: " + e.toString() ); 493 temporalClause = ""; 494 doTemporal = false; 495 } 496 497 String whereClause = ""; 498 if ( doSpatio && doTemporal ) 499 { 500 whereClause = " WHERE " + spatialClause + " AND " + temporalClause + " "; 501 } 502 else if ( doSpatio && !doTemporal ) 503 { 504 whereClause = " WHERE " + spatialClause + " "; 505 } 506 else if ( doTemporal && !doSpatio ) 507 { 508 whereClause = " WHERE " + temporalClause + " "; 509 } 510 else 511 { 512 whereClause = ""; 513 } 433 514 /* 434 435 436 437 438 439 440 441 442 443 515 xqueryStr = xqueryStr.replaceFirst("__subst_spatioTempWhereClause__", whereClause ); 516 517 xqueryStr = xqueryStr.replaceFirst("__subst_doTerm__", this.doTerm ? "fn:true()" : "fn:false()"); 518 xqueryStr = xqueryStr.replaceFirst("__subst_doSpatioTemp__", (this.doSpatio | this.doTemporal) ? "fn:true()" : "fn:false()"); 519 xqueryStr = xqueryStr.replaceFirst("__subst_doOrderBy__", this.doOrderBy ? "fn:true()" : "fn:false()"); //NB replaceAll cos more than 1! 520 xqueryStr = xqueryStr.replaceFirst("__subst_doScope__", this.doScope ? "fn:true()" : "fn:false()"); 521 522 //System.out.println("Xquery was \n" + xqueryStr); 523 524 queryParams.addElement( xqueryStr.getBytes("UTF-8") ); 444 525 */ 445 queryParams.addElement( this.howMany.intValue() ); 446 queryParams.addElement( this.start.intValue() ); 447 //System.out.println("start \n" + this.start.intValue()); 448 //System.out.println("howMany \n" + this.howMany.intValue()); 449 450 Hashtable options = new Hashtable(); 451 options.put("indent", "yes"); 452 options.put("encoding", "UTF-8"); 453 options.put("process-xsl-pi", "no"); 454 queryParams.addElement( options ); 455 byte[] resultByteArray = (byte[])xmlrpc.execute( "query", queryParams ); 456 ByteArrayInputStream resultStream = new ByteArrayInputStream( resultByteArray ); 457 458 // Mark the beginning of the Stream, so can reset before each xpath evaluation (!) 459 resultStream.mark( resultStream.available() ); 460 InputSource resultSource = new InputSource( resultStream ); 461 462 XPath xpath = XPathFactory.newInstance().newXPath(); 463 String hitsExpr = "/exist:result/@hits"; 464 String documentExpr = "//exist:result/document"; 465 xpath.setNamespaceContext( new existNamespaceContextImpl() ); 466 467 // If there is a successful search but with no hits, exist sets hitCount=0 rather than hits=0 !! 468 // Need to check that the thing returned by xpath will convert to an int 469 try 470 { 471 int xpathHits = (new Integer( xpath.evaluate(hitsExpr, resultSource) )).intValue(); 472 result.setHits( xpathHits ); 473 } 474 catch (NumberFormatException e) 475 { 476 result.setHits( 0 ); 477 } 478 479 resultStream.reset(); 480 NodeList nodeList = (NodeList)xpath.evaluate( documentExpr, resultSource, XPathConstants.NODESET ); 481 482 if ( result.getHits() > 0) 483 { 484 Vector documents = new Vector(); 485 for (int i=0; i<nodeList.getLength(); i++) 486 { 487 Hashtable thisDoc = new Hashtable(); 488 thisDoc.put("name", nodeList.item(i).getFirstChild().getNodeValue() ); 489 thisDoc.put("matches", 1); 490 thisDoc.put("position", i); 491 documents.add( thisDoc ); 492 } 493 result.setStatus( true ); 494 result.setStatusMessage( "Success" ); 495 result.setDocuments( documents ); 496 } 497 else 498 { 499 result.setStatus( false ); 500 result.setStatusMessage("Search was successful but generated no results."); 501 } 502 503 504 505 } 506 catch (org.apache.xmlrpc.XmlRpcException e) 507 { 508 status = false; 509 statusMessage = "Search failed - reason : " + e.toString(); 510 result.setStatus(false); 511 result.setStatusMessage( statusMessage ); 512 } 513 catch (Exception e) 514 { 515 status = false; 516 statusMessage = "An error ocurred - details : " + e.toString(); 517 result.setStatus( status ); 518 result.setStatusMessage( statusMessage ); 519 } 520 521 return result; 526 queryParams.addElement( this.howMany.intValue() ); 527 queryParams.addElement( this.start.intValue() ); 528 //System.out.println("start \n" + this.start.intValue()); 529 //System.out.println("howMany \n" + this.howMany.intValue()); 530 return null; 522 531 } 523 532 -
TI01-discovery/branches/ws-Discovery2-upgrade/src/ndg/services/discovery/ServiceProperties.java
r3950 r3952 12 12 public ServiceProperties() 13 13 { 14 properties.setProperty("jdbc.uri","jdbc:postgresql://glue.badc.rl.ac.uk/ndg_spatial"); 15 properties.setProperty("jdbc.username","postgres"); 16 properties.setProperty("jdbc.password","postgresDB"); 14 properties.setProperty("jdbc.uri","jdbc:postgresql://glue.badc.rl.ac.uk/calum:51000"); 15 properties.setProperty("jdbc.username","calum"); 16 properties.setProperty("jdbc.password","boybear"); 17 // properties.setProperty("jdbc.uri","jdbc:postgresql://glue.badc.rl.ac.uk/ndg_spatial"); 18 // properties.setProperty("jdbc.username","postgres"); 19 // properties.setProperty("jdbc.password","postgresDB"); 17 20 18 21 properties.setProperty("namespace.DIF", "http://gcmd.gsfc.nasa.gov/Aboutus/xml/dif/");
Note: See TracChangeset
for help on using the changeset viewer.