Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Voicetools » Database Module Not Working(Database Module Not Working)
icon8.gif  Database Module Not Working [message #830303] Tue, 27 March 2012 09:08 Go to next message
Amr Adel is currently offline Amr Adel
Messages: 2
Registered: March 2012
Junior Member
Dears,

I need your assist as i tried everything to make Database module work in v3 and no way, so if any one knows how to fix the database module problem please tell me
the call hangs when it comes to database
if there is another way to connect to database kindly tell me
Thanks,
Re: Database Module Not Working [message #831977 is a reply to message #830303] Thu, 29 March 2012 11:37 Go to previous messageGo to next message
Randy Childers is currently offline Randy Childers
Messages: 121
Registered: July 2009
Senior Member
Hi Amr--

I'm afraid that Database support in the v3 codebase is a bit limited --
single-table queries only, and no writes. However, you always have the
option of creating a Java plugin, or just writing it in Javascript, if
you need something more involved. In general, if you have the option,
I'd suggest upgrading to the 4.0 codestream, which is what is currently
live on the VTP repositories. I'll be posting a separate message
shortly on how to do this. Know that there are upgraders built in, so
that your current callflows will be upgraded to the newer format the
first time you open them. However, this is a one-way trip, so if you
aren't sure you want to commit to 4.0, keep a backup copy.

As to making it work in the 3.0 version, the most helpful thing to
troubleshoot this would be the catalina.out logs (or whatever logfile
your Java servelet container uses for system output) when the call
reaches the db query. More than likely, there will be an illuminating
error there.

Not knowing anything else about your problem though, I can offer these
general suggestions:
* do you have the supporting Java files for interacting with your
database? For example, Java doesn't deal natively with Oracle db's, but
there are plugins that will allow it to. That plugin, if you need it,
should be in the Dependencies folder of your application when you export
it.
* did you fill out the db export wizard screen completely?
* does the account you provided in the export wizard screen work using
other mechanisms? I.e., could there be an issue with permission /
authentication?

I hope one of these suggestions provide the spark of an idea; if not,
please post your application log here and let's take a look at the db
error.

Randy


In <jkse4j$krr$1@xxxxxxxxe.org> Amr Adel wrote:
> Dears,
>
> I need your assist as i tried everything to make Database module work
> in v3 and no way, so if any one knows how to fix the database module
> problem please tell me the call hangs when it comes to database if
> there is another way to connect to database kindly tell me Thanks,
>
Re: Database Module Not Working [message #834123 is a reply to message #831977] Sun, 01 April 2012 08:48 Go to previous messageGo to next message
Amr Adel is currently offline Amr Adel
Messages: 2
Registered: March 2012
Junior Member
Dear Randy,

Many thanks for your fast response, can you give me more details about writing javascript to conact to a SQL server and get data from a table
also what type of plugin can i use and hard it is to creat a one
Also i tried v4 but i cant deploy the war on tomcate as it returns access forbiden
Re: Database Module Not Working [message #836585 is a reply to message #834123] Wed, 04 April 2012 12:58 Go to previous message
Randy Childers is currently offline Randy Childers
Messages: 121
Registered: July 2009
Senior Member
Hi Amr--

Accessing a db from Javascript is really a two-step process for the
beginner. The first step is just to work out the Java required to do
this. I would recommend starting a simple Java project in Eclipse, and
then working through the code until you're making contact with the
database and performing the operations you need. Here's a code example
for accessing a SQL Server db through Java:
http://www.java2s.com/Tutorial/Java/0340__Database/
Connecttodatabaseandcallstoredprocedure.htm

Once you've got the code worked out, you'll need to make a few
translations to get it to work in Javascript. Basically, the main issue
is that classes which you would import in your Java code need to be
explicitly referenced every time in Javascript. Here's a relevant bit
from our User's Guide which will help you along with this:

--------------------------------------------------------
Using Java in a Script Module

Any Java object that's available to the JVM can be invoked from within a
script block; it just needs to be done explicitly. For example, here's
how to use the Java date object:
var d = new java.util.Date();
Log.info('date: ' + d); Note that Java classes which are automatically
imported in a normal Java environment aren't in this case. For example,
the String object can still be used, it just needs an explicit
declaration:
var str = new java.lang.String(Variables.myOldString);
Log.info('substring: ' + str.substring(2,3));
For more detail on using Java in JavaScript, this is a reference
provided by the creators of the JavaScript engine we use:
https://developer.mozilla.org/en/Scripting_Java
--------------------------------------------------------

As for your second question, writing a plugin for Eclipse is a bit more
involved than what I can cover here. I'd suggest a good book to get
your started. In the office, we use _The Java Developer's Guide to
Eclipse_ as a solid reference.

Finally, regarding your last note about the access forbidden error, it
probably just means that you're using the wrong URL. The way the URL is
built is:
http://<tomcat IP>:<tomcat port>/<warfile name>/<application name>/
<begin block name>

So, if you had an application named AcmeIVR, with a single stock begin
block named Begin, exported to a file called acme.war, on a tomcat
server serving on port 8080 with an IP of 1.2.3.4, your URL would look
like this:

http://1.2.3.4:8080/acme/AcmeIVR/Begin

Hope this helps--
Randy

PS -- You're better off with the 4.0 codebase straight from the VTP,
instead of the 3.x installer you downloaded from our site a few hours
ago.





In <jl9iqt$cvr$1@xxxxxxxxe.org> Amr Adel wrote:
> Dear Randy,
>
> Many thanks for your fast response, can you give me more details about
> writing javascript to conact to a SQL server and get data from a table
> also what type of plugin can i use and hard it is to creat a one
> Also i tried v4 but i cant deploy the war on tomcate as it returns
> access forbiden
>
Previous Topic:Is there a way to have voice (vox) files out of the WAR file
Next Topic:how to pass request parameters to openvxml web app
Goto Forum:
  


Current Time: Mon Apr 21 05:54:14 EDT 2014

Powered by FUDForum. Page generated in 0.08642 seconds