public interface DatabaseStatementParser
ParsedDatabaseStatement
.
Insert, update, delete and select table statements are supported. For each of these, the model will be the table name
(the first table if the statement includes more than one table) and the operation will be the statement type (select,
insert, update or delete).
Some stored procedure statements are also supported. Create and drop procedure statements will be parsed as
Procedure/create and Procedure/drop - the name of the procedure is not included in the metric space since these calls
should be infrequent. Stored procedure calls ("call foo();") will be parsed so that the model is the name of the
procedure and the operation is 'call'.
This class is immutable and therefore thread safe.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
INSERT_OPERATION |
static java.lang.String |
SELECT_OPERATION |
static ParsedDatabaseStatement |
UNPARSEABLE_STATEMENT
This is returned when parsing a statement in leu of returning null.
|
Modifier and Type | Method and Description |
---|---|
ParsedDatabaseStatement |
getParsedDatabaseStatement(com.newrelic.agent.bridge.datastore.DatabaseVendor databaseVendor,
java.lang.String statement,
java.sql.ResultSetMetaData resultSetMetaData)
Returns a parsed statement even if the statement is unparseable.
|
static final java.lang.String SELECT_OPERATION
static final java.lang.String INSERT_OPERATION
static final ParsedDatabaseStatement UNPARSEABLE_STATEMENT
ParsedDatabaseStatement getParsedDatabaseStatement(com.newrelic.agent.bridge.datastore.DatabaseVendor databaseVendor, java.lang.String statement, java.sql.ResultSetMetaData resultSetMetaData)
databaseVendor
- statement
- resultSetMetaData
-