~ubuntu-branches/ubuntu/oneiric/mysql-connector-java/oneiric

« back to all changes in this revision

Viewing changes to src/com/mysql/jdbc/util/VersionFSHierarchyMaker.java

  • Committer: Bazaar Package Importer
  • Author(s): Michael Koch
  • Date: 2007-11-30 10:34:13 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20071130103413-mxm4lpfrr4fnjbuj
Tags: 5.1.5+dfsg-1
* New upstream release. Closes: #450718.
* Add Homepage field to debian/control.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 Copyright (C) 2005 MySQL AB
 
2
 Copyright (C) 2005-2006 MySQL AB
3
3
 
4
4
 This program is free software; you can redistribute it and/or modify
5
5
 it under the terms of version 2 of the GNU General Public License as 
47
47
                
48
48
                String jdbcUrl = null;
49
49
 
50
 
                
51
 
                jdbcUrl = System.getProperty("com.mysql.jdbc.testsuite.url");
52
 
                
53
 
                
54
 
                Connection conn = new NonRegisteringDriver().connect(jdbcUrl, null);
55
 
 
56
 
                ResultSet rs = conn.createStatement().executeQuery("SELECT VERSION()");
57
 
                rs.next();
58
 
                String mysqlVersion = removeWhitespaceChars(rs.getString(1));
59
 
 
60
50
                String jvmVersion = removeWhitespaceChars(System.getProperty("java.version"));
61
51
                String jvmVendor = removeWhitespaceChars(System.getProperty("java.vendor"));
62
52
                String osName = removeWhitespaceChars(System.getProperty("os.name"));
63
53
                String osArch = removeWhitespaceChars(System.getProperty("os.arch"));
64
54
                String osVersion = removeWhitespaceChars(System.getProperty("os.version"));
65
55
                
 
56
                jdbcUrl = System.getProperty("com.mysql.jdbc.testsuite.url");
 
57
                
 
58
                String mysqlVersion = "not-available";
 
59
                
 
60
                try {
 
61
                        Connection conn = new NonRegisteringDriver().connect(jdbcUrl, null);
 
62
        
 
63
                        ResultSet rs = conn.createStatement().executeQuery("SELECT VERSION()");
 
64
                        rs.next();
 
65
                        mysqlVersion = removeWhitespaceChars(rs.getString(1));
 
66
                } catch (Throwable t) {
 
67
                        mysqlVersion = "no-server-running-on-" + removeWhitespaceChars(jdbcUrl);
 
68
                }
 
69
 
66
70
                String jvmSubdirName = jvmVendor + "-" + jvmVersion;
67
71
                String osSubdirName = osName + "-" + osArch + "-" + osVersion;
68
72