Grinder python script call pl/sql insert into database?

Gang Yan <[email protected]> Wed, 12 Nov 2014 17:52:59 -0800 (PST)
Newsgroups gmane.comp.java.grinder.user
Message-ID <d228e0bf-9718-4e1d-8708-23649aea7ac8@default>
Hi all:

 

I use python script test JDBC. python script call pl/sql:

class TestRunner:

    def __call__(self):

        endTime = datetime.now() + duration

        notDone = True

        while notDone:

         connection = None

         insertStatement = None

         queryStatement = None

         notDone = datetime.now() < endTime

 

        try:

            connection = getConnection()

            insertStatement = connection.createStatement()

 

            test1.record(insertStatement)

            insertStatement.execute

            (

             "begin

                for i in 1 .. 1000000000

                loop

                  insert into grinder_test123 values ( i, 'x' );

                  end loop;

                  commit;

                end;

                /

                "

            )

 

            test2.record(queryStatement)

            queryStatement.execute("select count(*) from grinder_test123")

 

        finally:

            ensureClosed(insertStatement)

            ensureClosed(queryStatement)

            ensureClosed(connection)

run script error info:

2014-11-11 10:28:20,859 ERROR uapgv4101.us.oracle.com-0: aborting process - Jython exception, : ('no viable alternative at character \'"\'', ('./test_jdbc.py', 108, 17, ' /"\n')) [initialising test script] net.grinder.scriptengine.jython.JythonScriptExecutionException: : ('no viable alternative at character \'"\'', ('./test_jdbc.py', 108, 17, ' /"\n'))

 

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk

_______________________________________________
grinder-use mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/grinder-use