matthiasblaesing commented on a change in pull request #2010: [NETBEANS-1603]
MySQL Procedures in DB Explorer
URL: https://github.com/apache/netbeans/pull/2010#discussion_r389876098
##########
File path: ide/db/src/org/netbeans/modules/db/explorer/node/ProcedureNode.java
##########
@@ -485,35 +493,36 @@ public String getBody() {
case Function:
case Procedure:
escapedName = getName().replace("'", "''");
- query = "SELECT body FROM mysql.proc WHERE name = '" +
escapedName + "';"; // NOI18N
- try (Statement stat =
connection.getJDBCConnection().createStatement();
- ResultSet rs = stat.executeQuery(query);) {
+ query = "SELECT routine_definition" // NOI18N
+ + " FROM information_schema.routines" // NOI18N
+ + " WHERE routine_name='" + escapedName + "';";
// NOI18N
+ try (Statement stat =
connection.getJDBCConnection().createStatement(); ResultSet rs =
stat.executeQuery(query);) {
while (rs.next()) {
- body = rs.getString("body"); // NOI18N
+ body = rs.getString("routine_definition"); //
NOI18N
}
}
break;
case Trigger:
escapedName = getName().replace("'", "''");
- query = "SELECT ACTION_STATEMENT FROM
information_schema.triggers WHERE TRIGGER_NAME = '" // NOI18N
- + escapedName + "';"; // NOI18N
- try (Statement stat =
connection.getJDBCConnection().createStatement();
- ResultSet rs = stat.executeQuery(query)) {
+ query = "SELECT action_statement" // NOI18N
+ + " FROM information_schema.triggers" // NOI18N
+ + " WHERE trigger_name='" + escapedName + "';";
// NOI18N
+ try (Statement stat =
connection.getJDBCConnection().createStatement(); ResultSet rs =
stat.executeQuery(query)) {
Review comment:
Plase put these on two statements onto two lines.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists