How to Connect Database Using Script?
Hi all,
Am using Adobe InDesign CS3. Is there any way to connect database from Adobe InDesign CS3 Scripting (Javascript)? Thanks in advance.
Regards,
Mohan
I don't know javascript so I can't help with that part.
The system plug in you need is from Actual Technologies : http://www.actualtechnologies.com/ The setup for that is detailed in their instructions. You will probably want to set it up for system-wide access, not by user. I found system-wide access more reliable, fwiw.
For Applescript I send a command through the Terminal/command line that returns the data from the query.
Here is Applescript:
set query to "YOUR DB QUERY"
set results to (do shell script "echo \"" & query & "\" | iodbctest \"dsn=" & dsn & ";uid=" & uid & ";pwd=" & pwd & "\" | awk '{ if (match($0,\"SQL>\")) {k++; if (k==1) next; if (k==2) exit; } if (k==1) print; }'")
You can probably do something similar in Javascript. You'll have to parse out the text data returned then. I think there may be plug-ins for InDesign that can directly connect to a database (?). Or some plug-ins like inData can take their data passed from a script as well.
Chris
Similar Messages
-
How to connect database using coding in trigger in forms
Oracle forms6i
Hai All
Is there any possiblity to connect database using coding.
For example when we open a form and we use some button and write some coding and when we execute a small will appear and we give username,connection identifier and database name.
Is it any possible there when we create a button and in that button we write coding our database name,connectionid and user and when we exe it will internally connect database Pls tell me..
Regards
Srikkanth.Muse LOGON Procedure
PROCEDURE LOGON
(username VARCHAR2,
password VARCHAR2);
logon('scott','tiger@orcl');Mr.Srikkanth.M if u dont close ur old questions dont expect others to answer ur question everytime......so plz remember if u think the person's answer is helpful or correct mark it accordingly
Thanks :)
Baig
[My Oracle Blog|http://baigsorcl.blogspot.com/] -
How to connect database using JDBc?
Hi All,
I developed one Microsoft Access Database named "Test.mdb" in my "C" drive,
i used
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc:odbc:C:\Test";
Connection con=DriverManager.getConnection(url);
While executing the above code, I m getting the following error
Error occurs java.sql.SQLException : No suitable driver
please help me what is the problem..i did code in proper try catch block ... so dont worry but let me know what is exactly reson behibd getting this querry....
my email id is : [email protected]
waiting for ur reply.. its urgentWhile executing the above code, I m getting the following error
Error occurs java.sql.SQLException : No suitable driverDon't post your e-mail.
This error always means that the URL you gave to connect to the database is incorrect. Yours is indeed wrong:
String url = "jdbc:odbc:C:\Test";You can correct it in either one of two ways:
(1) Create a DNS in Windows that points to your database (call it "Test") and change the URL so it says
String url = "jdbc:odbc:Test";(2) You can skip creating a DNS and use a connection String that looks like this:
"jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=<database-path>";In your case, <database-path> is "C:\\Test"
Better read a tutorial:
http://java.sun.com/docs/books/tutorial/jdbc/
% -
How to connect database using oracle SQL developer
Hello
I am newbie in EBS R12
I downloaded Oracle SQL Developer
and create new database conenction
Connection name: ebs demo db connection
username:
password:
Role: Default
Connection type: Basic
Hostname: ebstailin.demo.com
Port: 1521
SID: clone
when i try this there is an error
Status: Failure-Test failed: lo exception: The Network Adapter could not establish the connection
no idea about this
but i used the apps/apps as username and password
please help
thanks
Edited by: cheesewizz on Jul 16, 2010 11:35 PMHello
Thanks for your reply
I tried to connect and here is the result: see below
[oracle@ebstailin 11.1.0]$ sqlplus / as sysdba
SQL*Plus: Release 11.1.0.7.0 - Production on Sat Jul 17 15:35:31 2010
Copyright (c) 1982, 2008, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> CONNECT apps/apps
Connected.
SQL>
But still cannot connect using ORACLE SQL Developer
thanks -
How to connect database using JSF??
When I deployed a JSF war file which was connected to MySql on Sun Application Server, then lanuched it, why there was an error message like "HTTP Status 503 - This application is not currently available". Can anyone tell me why? thanks.
Thanks pringi~~!!
I still have problems about the database connection. I had tried many examples which were provided by some books. However, once I deployed the application, it still got problems. Can anyone help me and provide a example about the database connection. Thanks a lot. -
How to connect database using type4 driver(dsn or dsnless connection)
please send any one reply answer
One reply - not possible.
DSN/DSNless refers to a specific driver. And that driver is not a type 4 driver. So it is not possible. -
How to create database using shell script
hai
how to create database using shell scriptThe documentation details the steps to create a database manually. Another option is to use DBCA to create the scripts. DBCA will give you a complete set of scripts that will create a database.
http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14231/create.htm#sthref220 -
Connect database using ext javascript or applescipt in indesign
Hi,
I need to connect oracle database using extended javascript or apple script in indesign. Can somebody help by giving any suggestion. Or is there any possibility to connect database using the two scripting methods.
It is really urgent.
Thanks
Karthik BExtendScript has a Socket object prototype you can use to e.g. connect to the internet. Calling a web service would probably be more elegant than addressing the database directly. Socket is fairly low-level, though. If you need something easier, you could always try out http://extendables.org/docs/packages/http/doc/readme.html
I seem to recall some InDesign plug-ins you could buy that allow you to connect to a database directly, but you'd have to google that yourself. -
Is it possible to connect database using session bean
Dear all,
Is it possible to connect database using session bean without using entity beans like cmp,bmp.
if ur answer is yes, then pls tell me where to put the select statement and transaction attribute like(6 types).
if u have sample code, then it is good for me.
Hope I will get answer.Sure it is.
Try something like this (and maybe get a book on JDBC):
String name;
try {
InitialContext ic = new InitialContext();
DataSource ds = (DataSource) ic.lookup(Constants.MY_DATASOURCE);
Connection connection = ds.getConnection();
String sql = "SELECT * FROM TABLE";
PreparedStatement statement = connection.prepareStatement(sql);
ResultSet rs = statement.executeQuery();
while (rs.next()) {
name = rs.getString("NAME");
if (rs != null)
rs.close();
if (statement != null)
statement.close();
if (connection != null)
connection.close();
catch (NamingException e) {
// Can't get JDBC datasource
// ... do something with this exception
catch (SQLException e) {
// SQL exception from getter
// .... do seomthing with this one too
} -
How to connect peoplesoft using bapi?
how to connect peoplesoft using bapi?
points will be awardedHi,
You can actually connect any 2 systems, if they are capable of providing and consuming web services.
If you want to connect SAP to Peoplesoft to fetch or send data, then Peoplesoft should expose these functionalities in the form of Webservice. Then you will have to create Proxy Objects in SAP by consuming these webservices (SE80). Through this proxy object you can communicate with Peoplesoft.
Thanks...
Preetham S
Message was edited by:
Preetham S -
Help, how to Query database using pagination
hi,
how to Query database using pagination for the large data,
any API to do this?
thank you in advance!Hi,
You can specify XmlQueryContext::Lazy as your evaluation type, and only call XmlResults::next() as many times as you need results from it.
John -
How to connect database(oracle 10g) and retreive values using poral 10
can anyone help me how to connect to database and retreive values in detail and also please post the sample code if u have any.
Hello
Thanks for your reply
I tried to connect and here is the result: see below
[oracle@ebstailin 11.1.0]$ sqlplus / as sysdba
SQL*Plus: Release 11.1.0.7.0 - Production on Sat Jul 17 15:35:31 2010
Copyright (c) 1982, 2008, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> CONNECT apps/apps
Connected.
SQL>
But still cannot connect using ORACLE SQL Developer
thanks -
How to connect database(MSAccess ) in j2me
hi,
i'm new to j2me. can anyone tell me how to connect MsAccess database with the j2me.and also whether it is possible to connect or else we have to use some other database such as Mysql or oracle.
thanx a lot in advance
regards
laxmiNot directly. Please use the search, was already asked numerous times!
-
This is my jsp file!(
Claims Processing: Data Entry
Created on Apr 18, 2007
To change the template for this generated file go to
Window>Preferences>Java>Code Generation>Code and Comments
package Database;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.sql.DataSource;
@author Administrator
To change the template for this generated type comment go to
Window>Preferences>Java>Code Generation>Code and Comments
public class DataRetriever {
Connection connection = null;
public DataRetriever(String jndiName) {
try {
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
connection =
DriverManager.getConnection(
"jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=HRMS;User=sa;Password=sa");
System.err.println("Database connection established AGAIN");
} catch (Exception e) {
System.err.println("Cannot connect to database server - " + e);
private void getConnection(String jndi) {
try {
Context ctx = new InitialContext();
if (ctx == null) {
throw new Exception("Boom - No Context");
DataSource ds = (DataSource) ctx.lookup("java:comp/env/" +jndi);
System.err.println(jndi);
if (ds != null) {
connection = ds.getConnection();
} catch (Exception e) {
e.printStackTrace();
connection = null;
public ResultSet execSelectQuery(String sql) {
try {
if (connection == null) {
return null;
Statement s = connection.createStatement();
return s.executeQuery(sql);
} catch (SQLException e) {
e.printStackTrace();
return null;
public int execUpdateQuery(String sql) {
try {
if (connection == null) {
return -1;
Statement s = connection.createStatement();
return s.executeUpdate(sql);
} catch (SQLException e) {
e.printStackTrace();
return -1;
public void terminate() {
try {
connection.close();
} catch (SQLException e) {
e.printStackTrace();
This is the servlet.
package servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import bean.createClaimsBean;
public class CreateClaimsServlet extends HttpServlet {
protected void doGet(
HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
protected void doPost(
HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
private void processRequest(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException{
String mySqlJndiName =
this.getServletContext().getInitParameter("MySql JNDI");
createClaimsBean cb = new createClaimsBean();
String bd = request.getParameter("textfield1");
String pl = request.getParameter("textfield2");
String pa = request.getParameter("textfield3");
String bn = request.getParameter("textfield3");
String d = request.getParameter("D1");
String ta = request.getParameter("textfield4");
System.out.println("n");
cb=cb.registerCreateClaims(bd, pl, pa, bn, d, ta, mySqlJndiName);
request.getSession().setAttribute("registerCreateClaims", cb);
request.getRequestDispatcher("/WEB-INF/pages/regsuccess.jsp").forward(request,
response);
Lastly it is the java file.
Created on Apr 19, 2007
To change the template for this generated file go to
Window>Preferences>Java>Code Generation>Code and Comments
package bean;
import Database.DataRetriever;
@author Administrator
To change the template for this generated type comment go to
Window>Preferences>Java>Code Generation>Code and Comments
public class createClaimsBean {
private String billDate;
private String plans;
private String panel;
private String billNo;
private String dependent;
private String totalAmt;
public createClaimsBean(String billDate,String plans,String panel,String billNo,String dependent,String totalAmt)
this.billDate = billDate;
this.plans = plans;
this.panel = panel;
this.billNo = billNo;
this.dependent = dependent;
this.totalAmt = totalAmt;
@return
public String getBillDate() {
return billDate;
@return
public String getBillNo() {
return billNo;
@return
public String getDependent() {
return dependent;
@return
public String getPanel() {
return panel;
@return
public String getPlans() {
return plans;
@return
public String getTotalAmt() {
return totalAmt;
@param string
public void setBillDate(String string) {
billDate = string;
@param string
public void setBillNo(String string) {
billNo = string;
@param string
public void setDependent(String string) {
dependent = string;
@param string
public void setPanel(String string) {
panel = string;
@param string
public void setPlans(String string) {
plans = string;
@param string
public void setTotalAmt(String string) {
totalAmt = string;
public createClaimsBean{
public void registerCreateClaims(String mysql, String billNo, String dependent, String panel, String plans, String totalAmt)
DataRetriever data = new DataRetriever(mysql);
String sql= "INSERT INTO claims VALUES (billDate, billNo, dependent, panel, plans, totalAmt)";
data.execUpdateQuery(sql);
data.terminate();
How to connect sql so that i m able to insert new data into the database?
Message was edited by:
fatimah rasheedHi Fatimah,
You are on the right way. You need a DataSource to get Connection to the DB and execute queries through it. Have a look at <a href="http://help.sap.com/saphelp_nw04/helpdata/en/15/6d56f65fb59e4db97253c89c5cfefd/frameset.htm">this</a> page for more information on setting up a reference to the DataSource from your Web application.
The procedure for creating a custom DataSource is described <a href="http://help.sap.com/saphelp_nw04/helpdata/en/bb/69da54d8aedc419d46d9ea074e4d41/frameset.htm">here</a>. You can also <a href="http://help.sap.com/saphelp_nw04/helpdata/en/7f/d84b25d49846819d08e1c8ba03a9cd/frameset.htm">use the default DataSource</a>.
Hope it helps!
-Vladimir
PS. Don't use java.sql.DriverManager directly in a J2EE environment. It is designed for standalone usage in the J2SE environment. The recommended way for J2EE is to go through a <b>javax.sql.DataSource</b> object. -
How to delete database using sql
I have to delete some databases from oracle 8i. I tried it using the Database Configuration Assistant and I get stuck indefinately as the message always says connecting but nothing happens.
How can I delete databases using sql not thru the DCA?
Thanksfiles related to the database and follow these steps:
1.- shutdown the database
2.- Delete all files ( Control Files, .dbf, Redo's, Archive�s, parameter file, password file )
3.- Delete the entrance of this database from
listener.ora and from tnsnames.ora files.
and that's it.
Joel P�rez
Maybe you are looking for
-
I licensed PS Tuesday and used it fine but today it is not reactive - What is the problem
I recenly decided PS3 was no longer working for me so installed the trial for new PS and it worked great so I licensed it Tuesday and it worked well but cant get it to work today. it opens but is not reactive. Spent hours on hold but cant get any hel
-
Drill from Financial Report to SQL Spreadsheet not working
Has anyone had any experience with getting a Financial Report [or Web Analysis OLAP Report] to drill to a Web Analysis SQL Spreadsheet? The Financial Report uses the SQL Spreadsheet as related content. The SQL Spreadsheet does have the column mapping
-
Does anyone know of a product similar to Inxight Software's Star Tree product for static web sites that will provide a graphical representation of content area navigation within Portal?
-
When I open Organizer the toolbar/menu bar (file, edit, find, view, window, help) is not shown. Instead I have to search for a hidden box that opens these items when clicked. How do I get this menu bar to show? Thanks for your help
-
If Apple incorrectly showed more bars than it should have... wouldn't most
phone makers do the same, to make their phone look better? I lost two bar after upgrading, but I do seem to have similar service. No dropped calls.