1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0//EN">
6 <style type=
"text/css">
9 font-family: verdana
, sans-serif
;
29 text-decoration:underline
;
34 text-decoration: none
;
47 border-bottom-width:1px;
48 border-bottom-style:dotted
;
64 <table width=
"90%" border=
"0" cellspacing=
"1" cellpadding=
"5">
67 <big><tt>Global.helma.sqlshell.getDatasources
()
</tt></big><br>
73 Get an array of names of all defined data sources suitable for use
74 in html.select macro.
<br><br>
88 <table width=
"90%" border=
"0" cellspacing=
"1" cellpadding=
"5">
90 <td>Sourcecode in helmaTools.zip/Global/helma.sqlshell.js:
91 <pre><font color=
"#aaaaaa">18:
</font> helma.sqlshell.getDatasources = function() {
92 <font color=
"#aaaaaa">19:
</font> var dbmap = app.getDbProperties();
93 <font color=
"#aaaaaa">20:
</font> var sources = [];
94 <font color=
"#aaaaaa">21:
</font> for (var i in dbmap) {
95 <font color=
"#aaaaaa">22:
</font> var dot = i.indexOf(
<font color=
"#9999aa">".
"</font>);
96 <font color=
"#aaaaaa">23:
</font> if (dot
> -
1 && i.lastIndexOf(
<font color=
"#9999aa">".url
"</font>) == i.length-
4) {
97 <font color=
"#aaaaaa">24:
</font> var source = i.substring(
0, dot);
98 <font color=
"#aaaaaa">25:
</font> sources.push([source, source]);
99 <font color=
"#aaaaaa">26:
</font> }
100 <font color=
"#aaaaaa">27:
</font> }
101 <font color=
"#aaaaaa">28:
</font> return sources;
102 <font color=
"#aaaaaa">29:
</font> }