From: | judoscript(at)hotmail(dot)com (James Huang) |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | [ANN] A Genuine JDBC Scripting Language |
Date: | 2001-11-17 07:58:07 |
Message-ID: | 52719db8.0111162358.2a2b94e7@posting.google.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Greetings!
Introducing JudoScript, a full-fledged scripting
language that supports genuine JDBC scripting. Free
form SQL statements can be specified and executed
either individually or in a group or batch.
Expressions can be embedded in the SQL statements.
SQL statements can be prepared and run with bind
parameters. Stored procedure calls can take in-,
out- and bidirectional bind parameters. Multiple
connections can be set up independently and SQL
statements are bound to each.
The article at
http://www.judoscript.com/articles/jdbc.html
explains everything with a lot of sample scripts that
are runnable against Oracle and Microsoft SQL Server.
JudoScript is a powerful cross-database,
cross-format data processing language. Multiple
database connections can be set up simultaneously,
data from all databases are in JDBC SQL data types,
so cross-database transfer is natural. In addition
to JDBC scripting, JudoScript also supports XML
scripting, file operations, HTML/HTTP downloading
and scraping, networking, EJB invocation, and last
but not least, it is a complete general purpose
programming language with robust data strctures
that support sophisticated algorithms.
JudoScript has a built-in scheduler that can run
any tasks, including database operations, running
native executables and sending mails. The scheduled
jobs have an embedded control panel accessed via
HTTP, allowing system administrators to monitor
and/or control the job. For more information, visit
The following is a simple example to give you a
sense what the code looks like:
//
// connect to database as the default connection
//
connect to 'jdbc:oracle:thin:@localhost:1521:somedb',
'dbuser', 'dbpass';
//
// create a table and an index
//
executeSQL {
create table newborn (
id int primary key,
name varchar(50) not null,
birthday date
);
create index emp_name on newborn(name);
}
//
// insert a few records using static SQL.
//
$data = new orderedMap (
'Michelle' = date(2001,11,14, 9,12, 5),
'Daniel' = date(2001,11,14,14,45, 8),
'Kristine' = date(2001,11,14,23,58,48)
);
$id = 100;
for $x in $data.keys() {
executeSQL
insert into newborn (id,name,birthday)
value ( (* $id++ *), (* $x *), (* $data.($x) *) );
}
//
// make a query with prepared SQL
//
prepare $q:
select id, name from newborn where birthday < ?
;
executeQuery $q
with @1:timestamp = date(2001,11,14,12,0,0);
println 'Babies born in the afternoon:';
while $q.next() {
println $q[1] :>5, ' ', $q[2]; // first column right adjusted
// println $q.id :>5, ' ', $q.name; // another way.
}
Cheers!
James Huang, author of JudoScript
From | Date | Subject | |
---|---|---|---|
Next Message | Grant Table | 2001-11-17 08:55:22 | Re: Triggers, functions and column names: a poser |
Previous Message | Brent Verner | 2001-11-17 06:34:47 | Re: table names |