public static List<OStatement> parseScript(InputStream script, ODatabaseDocumentInternal db) { try { final OrientSql osql = new OrientSql(script); List<OStatement> result = osql.parseScript(); return result; } catch (ParseException e) { throw new OCommandSQLParsingException(e, ""); } }
db = (ODatabaseDocumentInternal) ((OrientJdbcConnection) statement.getConnection()).getDatabase(); if (db == null) { osql = new OrientSql(new ByteArrayInputStream(statement.sql.getBytes())); } else { osql = new OrientSql(new ByteArrayInputStream(statement.sql.getBytes()), db.getStorage().getConfiguration().getCharset()); OLogManager.instance() .warn(this, "Invalid charset for database " + db + " " + db.getStorage().getConfiguration().getCharset()); osql = new OrientSql(new ByteArrayInputStream(statement.sql.getBytes())); } catch (Exception e) { throw new RuntimeException(e);
osql = new OrientSql(is); } else { try { osql = new OrientSql(is, db.getStorage().getConfiguration().getCharset()); } catch (UnsupportedEncodingException e2) { OLogManager.instance() .warn(null, "Unsupported charset for database " + db + " " + db.getStorage().getConfiguration().getCharset()); osql = new OrientSql(is);