avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hamm...@apache.org
Subject cvs commit: jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/driver AvalonDBDriver.java
Date Sun, 04 Nov 2001 11:41:25 GMT
hammant     01/11/04 03:41:25

  Modified:    apps/db/src/java/org/apache/avalon/db/driver
                        AvalonDBDriver.java
  Log:
  Gerhard's patch for basic url validation.
  
  Revision  Changes    Path
  1.9       +7 -3      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/driver/AvalonDBDriver.java
  
  Index: AvalonDBDriver.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/driver/AvalonDBDriver.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AvalonDBDriver.java	2001/11/04 10:22:13	1.8
  +++ AvalonDBDriver.java	2001/11/04 11:41:25	1.9
  @@ -29,7 +29,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.8 $
  + * @version $Revision: 1.9 $
    */
   public class
           AvalonDBDriver extends AbstractDriver implements Driver {
  @@ -63,10 +63,14 @@
        */
       public Connection connect(String url, Properties info) throws SQLException {
   
  -        // jdbc:avalondb:<transport>:<syntax>:<database>:<host>:<port>
  -        //  0       1         2          3         4       5      6
  +        final String sampleTerms = "jdbc:avalondb:<transport>:<syntax>:<database>:<host>:<port>";
  +                                 //  0       1         2          3         4       5 
    6
   
           String[] words = StringUtils.split(url,":");
  +        if(words.length < 7) {
  +            throw new SQLException("Invalid JDBC URL. Seven terms are needed - " + sampleTerms);
  +        }
  +
   
           String driver = null;
           if (words[2].equals("cmds")) {
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>


Mime
View raw message