General discussion

Locked

How to connect a database to Applet

By bhun_78 ·
Hello
I have a database consisting of some values say some counts.I have to use this counts to plot barcharts. I think I can draw barchart using Applet. But may I know how to connect database thru applets. I can't use Frames becaz I want the barcharts in browser.

Thank U
Bhuns

This conversation is currently closed to new comments.

7 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

How to connect a database to Applet

by Al_<al@dugmore.com> In reply to How to connect a database ...

I am not a Java programmer, but I have found a way to feed data to an applet written by someone else: I simply use a database connected development environment (any will do: Cold Fusion, ASP, Tango, Perl, etc.). I query my tables and then format theresults using HTML applet parameter syntax, for example:

<applet archive="someapp.jar" code="someapp.class" width="135" height="225">
< %
Response.write '<param name="floatmode" value="' + floatvar +'">')
%>
</applet>

Assuming *floatvar* has been assigned previously, the applet gets the dynamic data as the page loads and all is right in the world.

JDBC is another topic to explore; it would allow you direct access to a database within the Java API, but I leave that to those who know more about it.

HTH <hope that helps>

Collapse -

How to connect a database to Applet

by bhun_78 In reply to How to connect a database ...

The question was auto-closed by TechRepublic

Collapse -

How to connect a database to Applet

by francodacosta In reply to How to connect a database ...

I'm not a java programer but this is how to connect to an ADO compilant DB using microsoft JScript.

var myConnect = "Provider=sqloledb;Data Source=" +
Request.ServerVariables("SERVER_NAME") + ";" +
"Initial Catalog=Northwind;User Id=sa;Password=;";
mySQL = "select * from Customers;";
showBlank = " ";
showNull = "-NULL-";

var connTemp = Server.CreateObject("ADODB.Connection");
connTemp.Open(myConnect);
rsTemp = Server.CreateObject("ADODB.Recordset");
rsTemp.ActiveConnection = connTemp;
rsTemp.CursorLocation = adUseClient;
rsTemp.CursorType = adOpenKeyset;
rsTemp.LockType = adLockOptimistic;
rsTemp.Source = mySQL;
rsTemp.Open();

I hope this was usefull

Collapse -

How to connect a database to Applet

by bhun_78 In reply to How to connect a database ...

The question was auto-closed by TechRepublic

Collapse -

How to connect a database to Applet

by Tech Geek In reply to How to connect a database ...

It depends what type of database you are trying to connect to. If it is an Oracle database you need to use the oracle thin. You will need to get a JDBC driver from the vendor of the database, unless you want to connect to an ODBC database. An ODBC driver is already part of the java core. It is called something like com.sun.jdbc.odbc
If you go to the website www.java.sun.com you will find tons of info. on java. If you search on this page for jdbc you should be able to quickly find an example of the syntax, but if you don't let me know I will post an example.

Collapse -

How to connect a database to Applet

by bhun_78 In reply to How to connect a database ...

The question was auto-closed by TechRepublic

Collapse -

How to connect a database to Applet

by bhun_78 In reply to How to connect a database ...

This question was auto closed due to inactivity

Back to Web Development Forum
7 total posts (Page 1 of 1)  

Related Discussions

Related Forums