@@ -635,15 +635,17 @@ static Stream<Arguments> statementUpdateStream() throws SQLException {
635635 new org .h2 .Driver ().connect (jdbcUrls .get ("h2" ), null ),
636636 null ,
637637 "CREATE TABLE S_H2 (id INTEGER not NULL, PRIMARY KEY ( id ))" ,
638- "CREATE TABLE jdbcunittest.S_H2" ,
638+ emitStableDatabaseSemconv () ? "CREATE TABLE S_H2" : "CREATE TABLE jdbcunittest.S_H2" ,
639639 "h2:mem:" ,
640640 "S_H2" ),
641641 Arguments .of (
642642 "derby" ,
643643 new EmbeddedDriver ().connect (jdbcUrls .get ("derby" ), null ),
644644 "APP" ,
645645 "CREATE TABLE S_DERBY (id INTEGER not NULL, PRIMARY KEY ( id ))" ,
646- "CREATE TABLE jdbcunittest.S_DERBY" ,
646+ emitStableDatabaseSemconv ()
647+ ? "CREATE TABLE S_DERBY"
648+ : "CREATE TABLE jdbcunittest.S_DERBY" ,
647649 "derby:memory:" ,
648650 "S_DERBY" ),
649651 Arguments .of (
@@ -659,15 +661,19 @@ static Stream<Arguments> statementUpdateStream() throws SQLException {
659661 cpDatasources .get ("tomcat" ).get ("h2" ).getConnection (),
660662 null ,
661663 "CREATE TABLE S_H2_TOMCAT (id INTEGER not NULL, PRIMARY KEY ( id ))" ,
662- "CREATE TABLE jdbcunittest.S_H2_TOMCAT" ,
664+ emitStableDatabaseSemconv ()
665+ ? "CREATE TABLE S_H2_TOMCAT"
666+ : "CREATE TABLE jdbcunittest.S_H2_TOMCAT" ,
663667 "h2:mem:" ,
664668 "S_H2_TOMCAT" ),
665669 Arguments .of (
666670 "derby" ,
667671 cpDatasources .get ("tomcat" ).get ("derby" ).getConnection (),
668672 "APP" ,
669673 "CREATE TABLE S_DERBY_TOMCAT (id INTEGER not NULL, PRIMARY KEY ( id ))" ,
670- "CREATE TABLE jdbcunittest.S_DERBY_TOMCAT" ,
674+ emitStableDatabaseSemconv ()
675+ ? "CREATE TABLE S_DERBY_TOMCAT"
676+ : "CREATE TABLE jdbcunittest.S_DERBY_TOMCAT" ,
671677 "derby:memory:" ,
672678 "S_DERBY_TOMCAT" ),
673679 Arguments .of (
@@ -683,15 +689,19 @@ static Stream<Arguments> statementUpdateStream() throws SQLException {
683689 cpDatasources .get ("hikari" ).get ("h2" ).getConnection (),
684690 null ,
685691 "CREATE TABLE S_H2_HIKARI (id INTEGER not NULL, PRIMARY KEY ( id ))" ,
686- "CREATE TABLE jdbcunittest.S_H2_HIKARI" ,
692+ emitStableDatabaseSemconv ()
693+ ? "CREATE TABLE S_H2_HIKARI"
694+ : "CREATE TABLE jdbcunittest.S_H2_HIKARI" ,
687695 "h2:mem:" ,
688696 "S_H2_HIKARI" ),
689697 Arguments .of (
690698 "derby" ,
691699 cpDatasources .get ("hikari" ).get ("derby" ).getConnection (),
692700 "APP" ,
693701 "CREATE TABLE S_DERBY_HIKARI (id INTEGER not NULL, PRIMARY KEY ( id ))" ,
694- "CREATE TABLE jdbcunittest.S_DERBY_HIKARI" ,
702+ emitStableDatabaseSemconv ()
703+ ? "CREATE TABLE S_DERBY_HIKARI"
704+ : "CREATE TABLE jdbcunittest.S_DERBY_HIKARI" ,
695705 "derby:memory:" ,
696706 "S_DERBY_HIKARI" ),
697707 Arguments .of (
@@ -707,15 +717,19 @@ static Stream<Arguments> statementUpdateStream() throws SQLException {
707717 cpDatasources .get ("c3p0" ).get ("h2" ).getConnection (),
708718 null ,
709719 "CREATE TABLE S_H2_C3P0 (id INTEGER not NULL, PRIMARY KEY ( id ))" ,
710- "CREATE TABLE jdbcunittest.S_H2_C3P0" ,
720+ emitStableDatabaseSemconv ()
721+ ? "CREATE TABLE S_H2_C3P0"
722+ : "CREATE TABLE jdbcunittest.S_H2_C3P0" ,
711723 "h2:mem:" ,
712724 "S_H2_C3P0" ),
713725 Arguments .of (
714726 "derby" ,
715727 cpDatasources .get ("c3p0" ).get ("derby" ).getConnection (),
716728 "APP" ,
717729 "CREATE TABLE S_DERBY_C3P0 (id INTEGER not NULL, PRIMARY KEY ( id ))" ,
718- "CREATE TABLE jdbcunittest.S_DERBY_C3P0" ,
730+ emitStableDatabaseSemconv ()
731+ ? "CREATE TABLE S_DERBY_C3P0"
732+ : "CREATE TABLE jdbcunittest.S_DERBY_C3P0" ,
719733 "derby:memory:" ,
720734 "S_DERBY_C3P0" ),
721735 Arguments .of (
@@ -753,8 +767,7 @@ void testStatementUpdate(
753767 trace .hasSpansSatisfyingExactly (
754768 span -> span .hasName ("parent" ).hasKind (SpanKind .INTERNAL ).hasNoParent (),
755769 span ->
756- span .hasName (
757- emitStableDatabaseSemconv () ? "CREATE TABLE " + table : spanName )
770+ span .hasName (spanName )
758771 .hasKind (SpanKind .CLIENT )
759772 .hasParent (trace .getSpan (0 ))
760773 .hasAttributesSatisfyingExactly (
@@ -768,9 +781,7 @@ DB_CONNECTION_STRING, emitStableDatabaseSemconv() ? null : url),
768781 equalTo (maybeStable (DB_SQL_TABLE ), table ),
769782 equalTo (
770783 DB_QUERY_SUMMARY ,
771- emitStableDatabaseSemconv ()
772- ? "CREATE TABLE " + table
773- : null ))));
784+ emitStableDatabaseSemconv () ? spanName : null ))));
774785 }
775786
776787 static Stream <Arguments > preparedStatementUpdateStream () throws SQLException {
0 commit comments