The Vertica Forum recently got a makeover! Let us know what you think by filling out this short, anonymous survey.

jdbc exception when profiling query

jdbc driver throws an error:   statement.execute("profile select 12.34 from dual;");

the problem appears to be the float result. "select 'foo' from dual" doesn't throw the error.
this is on vertica 6.1.2. stack trace follows and then code snippet.Exception:

thanks for any help. 

kevin wilkinson

java.sql.SQLException: [Vertica]For input string: "12.34"
        at java.lang.NumberFormatException.forInputString(Unknown Source)
        at java.lang.Long.parseLong(Unknown Source)
        at java.lang.Long.valueOf(Unknown Source)
        at com.vertica.dataengine.VResultSet.getRowCount(Unknown Source)
        at com.vertica.dataengine.VResultSet.fetchChunk(Unknown Source)
        at com.vertica.dataengine.VResultSet.initialize(Unknown Source)
        at com.vertica.dataengine.VQueryExecutor.readExecuteResponse(Unknown Source)
        at com.vertica.dataengine.VQueryExecutor.handleExecuteResponse(Unknown Source)
        at com.vertica.dataengine.VQueryExecutor.execute(Unknown Source)
        at com.vertica.jdbc.SStatement.executeNoParams(Unknown Source)
        at com.vertica.jdbc.SStatement.execute(Unknown Source)
        at bug.Bug.init(
        at bug.Bug.main(
Caused by: java.lang.NumberFormatException: For input string: "12.34"
        ... 13 more

        private static Properties buildPropertiesObject(boolean autoCommit) {
                        Properties properties = new Properties();
                        properties.put(USER, VERTICA_USR);
                        properties.put(PASSWORD, VERTICA_PWD);
                        properties.put(LOG_PATH, LOG_PATH_VALUE);
                        properties.put(LOG_LEVEL, LOG_LEVEL_VALUE);
                        properties.put(AUTOCOMMIT, autoCommit);

                        return properties;

        public static void init() throws IOException{
        try {

                Connection conn = DriverManager.getConnection(DB_URI,

                Statement statement = conn.createStatement();
                statement.execute("profile select 12.34 from dual;");
                ResultSet resultSet = statement.getResultSet();

                while( {
                        String line = resultSet.getString(1);


        } catch (SQLException e) {
                        System.out.println("Exception: " + e.toString());
        } catch (Exception e) {
                        System.out.println("Exception: " + e.toString());

        public static void main(String[] args) throws IOException{


  • Hi!

    Its problem not with JDBC (same story with ODBC) its a bug in Vertica.
    Vertica reports on PROFILE as non-query, i.e. query that do not returns a result, but actually returns a result and hint.

    As workaround you can enable session profiling and execute query normally.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file

Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.