Project

General

Profile

« Previous | Next » 

Revision 2984

Added by Matt Jones over 18 years ago

Patch for making getlastdocid work when the identifier is a large number
greater than can be encompassed by an int. Now it uses a long to
represent the number, which doesn't solve the problem but probably does
make it work for the vast majority of cases.

View differences:

src/edu/ucsb/nceas/metacat/DBUtil.java
365 365
      pstmt.execute();
366 366
      ResultSet rs = pstmt.getResultSet();
367 367
      
368
      int max = 0;
368
      long max = 0;
369 369
      String temp = null;
370 370
      
371 371
      while(rs.next()){
......
373 373
    	  if(temp != null){
374 374
    		  temp = temp.substring(temp.indexOf(scope) + scope.length() + 1);
375 375
    		  try {
376
    			  int localid = Integer.parseInt(temp);
377
    			  if (localid > max){
376
    			  long localid = Long.parseLong(temp);
377
    			  if (localid > max) {
378 378
    				  max = localid;
379 379
    				  accnum = rs.getString(1) + sep + rs.getString(2);
380 380
    			  }

Also available in: Unified diff