Wednesday, May 1, 2013

Re: Using of Jdbc.getConnection() statement in google apps script

Hi Tony Tseng,

I Might not asked the question clearly, So I have just explain it below again.

Actually I have several functions in my script file, After publishing doGet function all other functions are called using the serverHandlers, And I have used the statements like below, My doubt is can we use this "var conn=Jdbc.getCloudSqlConnection(dburl, user, pwd);" globally per script file instead of writing inside every function.

If Yes, Please provide a simple example to understand the concept of using it.

function doGet()
{
      var conn=Jdbc.getCloudSqlConnection(dburl, user, pwd);
      .............
      .............
      .............
      conn.close();
}
function X()
{
      var conn=Jdbc.getCloudSqlConnection(dburl, user, pwd);
      .............
      .............
      .............
      conn.close();
}
function Y()
{
      var conn=Jdbc.getCloudSqlConnection(dburl, user, pwd);
      .............
      .............
      .............
      conn.close();
}
function Z()
{
      var conn=Jdbc.getCloudSqlConnection(dburl, user, pwd);
      .............
      .............
      .............
      conn.close();
}

Tnx,
CL.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment