1
votes

I want to make oracle database connection through google script.

I am using below connection string:

var conn = Jdbc.getConnection("jdbc:oracle:thin:@//127.0.0.1:1521/XE", "username", "pwd"); 

and getting error as

We're sorry, a server error occurred. Please wait a bit and try again. (line 24, file "DatabaseConnection").

Could anyone suggest what I'm doing wrong?

1
Can you post your whole code for db connection?Mr.Rebot
Hi , I am trying to connect the database using the code below .function makeDatabaseConnection() { var conn = Jdbc.getConnection("jdbc:oracle:thin:@//127.0.0.1:1521/XE", "Balmukund", "test"); if (conn!=null) { Logger.log('database connected' ); } else { Logger.log('database not connected' ); } }Trivedi Balmukund
@TrivediBalmukund Check my answer. It have explained why you are not able to connect.Waqar Ahmad

1 Answers

0
votes

Apps Script can connect to a server which is reachable over a public IP address. I can see that you are using the localhost IP address which will definitely not be reachable from Apps Script Servers.

You can check the requirement in more detail on Google Apps Script JDBC Service Requirement. You can follow below link.

Google Apps Script Docs : Setup for other databases enter image description here