Announcement

Collapse
No announcement yet.

Does voltDB java client (5.2.2 version) require java 7 now?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Does voltDB java client (5.2.2 version) require java 7 now?

    Hi there,

    In AdminGuide.pdf shipped with voltDB 5.2.2, I saw the words below indicating the Java client is compatible with Java 6, which is good.

    Note that although the VoltDB server requires Java 7 or 8, the Java client is also compatible with Java 6.

    However, when I tried the following code from UsingVoltDB.pdf from voltDB 5.2.2,

    Code:
    import java.sql.*;
    import java.io.*;
    public class JdbcDemo {
            public static void main(String[] args) {
    		String driver = "org.voltdb.jdbc.Driver";
    		String url = "jdbc:voltdb://192.168.88.130:40011";
    		String sql = "SELECT dialect FROM helloworld";
    
    		try {
    			// Load driver. Create connection.
    			Class.forName(driver);
    			Connection conn = DriverManager.getConnection(url);
    			// create a statement
    			Statement query = conn.createStatement();
    			ResultSet results = query.executeQuery(sql);
    			while (results.next()) {
    				System.out.println("Language is " + results.getString(1));
    			}
    			// call a stored procedure
    			CallableStatement proc = conn.prepareCall("{call Select(?)}");
    			proc.setString(1, "English");
    			results = proc.executeQuery();
    			while (results.next()) {
    				System.out.printf("%s, %s!\n", results.getString(1),
    						results.getString(2));
    			}
    			// Close statements, connections, etc.
    			query.close();
    			proc.close();
    			results.close();
    			conn.close();
    		} catch (Exception e) {
    			e.printStackTrace();
    		}
    	}
    }
    I am seeing the error as follows.

    Exception in thread "main" java.lang.ExceptionInInitializerError
    at java.lang.J9VMInternals.initialize(J9VMInternals.j ava:222)
    at org.voltdb.jdbc.JDBC4Statement$VoltSQL.parseSQL(JD BC4Statement.java:209)
    at org.voltdb.jdbc.JDBC4Statement.executeQuery(JDBC4S tatement.java:461)
    at Test.main(Test.java:20)
    Caused by: java.util.regex.PatternSyntaxException: Look-behind group does not have an obvious maximum length near index 40
    \A\s*alter\s+(?:(?<parenttype>[a-z][a-z]*))\s+(?:(?<parentname>[\w$]+))(?:\s+(?:alter\s+(?:(?<childtype>[a-z][a-z]*))\s+(?:(?<childname>[\w$]+))))?\s+(?:rename)\s+(?:to).*\z
    ^
    at java.util.regex.Pattern.error(Pattern.java:1724)
    at java.util.regex.Pattern.group0(Pattern.java:2499)
    at java.util.regex.Pattern.sequence(Pattern.java:1817 )
    at java.util.regex.Pattern.expr(Pattern.java:1763)
    at java.util.regex.Pattern.group0(Pattern.java:2470)
    at java.util.regex.Pattern.sequence(Pattern.java:1817 )
    at java.util.regex.Pattern.expr(Pattern.java:1763)
    at java.util.regex.Pattern.compile(Pattern.java:1471)
    at java.util.regex.Pattern.<init>(Pattern.java:1144)
    at java.util.regex.Pattern.compile(Pattern.java:858)
    at org.voltdb.parser.SQLPatternPartElement.compile(SQ LPatternPartElement.java:166)
    at org.voltdb.parser.SQLLexer.<clinit>(SQLLexer.java: 131)
    at java.lang.J9VMInternals.initializeImpl(Native Method)
    at java.lang.J9VMInternals.initialize(J9VMInternals.j ava:200)
    ... 3 more


    And I figured that this is due to the usage of Java 6 in my client environment, as long as I change to Java 7 for my client, the error is gone and the application runs as expected.

    So does voltDB java client (5.2.2 version) require java 7 now?

    I hope not ...
    Last edited by lliang; 05-25-2015, 05:45 AM.

  • #2
    lliang,

    I'm going to take a look at this problem and get back to you.

    Peter Zhao

    Comment


    • #3
      lliang,

      Thanks for your patience and I apologize for the long delay. I've been able to reproduce the issue and created a ticket for this issue. As a workaround, please use java 7 for the time being.

      -Peter Zhao

      Comment

      Working...
      X