How to connect DB with applet
hi, all
I am use Mysql as my DB, but when I my program as window application, it is work, but when I run it as Applet, it won't work, can any one tell me how to access the data from DB to Applet?
public class AppletApp extends JApplet {
public void init() {
DefaultMutableTreeNode root = new DefaultMutableTreeNode("root");
try
Class.forName("org.gjt.mm.mysql.Driver");
catch(Exception e)
System.out.println(e.toString());
Connection cn;
Statement st;
ResultSet rs ;
try
cn = DriverManager.getConnection("jdbc:mysql://localhost:3306/cti", "root", "123");
st =cn.createStatement();
rs = st.executeQuery("select name from parent");
while (rs.next())
//System.out.println(rs.getString("name"));
DefaultMutableTreeNode NewNode = new DefaultMutableTreeNode(rs.getString("name"));
root.add(NewNode);
rs.close();
st.close();
cn.close();
}catch(SQLException se)
System.out.println(se.toString());
/*DefaultMutableTreeNode node1 = new DefaultMutableTreeNode("node1");
root.add(node1);
node1.add(new DefaultMutableTreeNode("sub1_1"));
node1.add(new DefaultMutableTreeNode("sub1_2"));
setSize(400, 400);*/
getContentPane().add(new JTree(root));
public static void main(String arg[]) {
JFrame myFrame = new JFrame();
Container contentPane = myFrame.getContentPane();
contentPane.setLayout(new GridLayout(1,2));
AppletApp app = new AppletApp();
contentPane.add(app, BorderLayout.CENTER);
app.init();
app.start();
myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
myFrame.setSize (600,600);
myFrame.setVisible(true);
}
I had signed the applet and there is a .jar file, but when I type
AppletViewer tree.html
there are still an sercuity error come out, so thing else I need to do?
am I need to modifty the html file? right now my html file resource code are look like this:
<html>
<applet code = x.class heigh = 300 width = 300>
</applet>
</html>
Similar Messages
-
Hi
Hi I just got my new Apple TV and I cant figure out how to connect it with My MacBook Air (11-inch, Late 2010- Processor 1.4 GHz Intel Core 2 Duo) OSX Version 10.8Are you referring to mirroring or you just unable to set up homesharing.
AirPlay Mirroring requires a second-generation Apple TV or later, OS X 10.8 or better and is supported on the following Mac models: iMac (Mid 2011 or newer), Mac mini (Mid 2011 or newer), MacBook Air (Mid 2011 or newer), and MacBook Pro (Early 2011 or newer). It also requires the computer to be using wi-fi. -
How to connect TL494 with IR2110
HI, does anyone know how to connect TL494 with IR2110 H bridge inverter??
Hello,
These arn't chips I've used before but a quick search did yield some interesting (and maybe useful!) results:
http://hmin.tripod.com/als/fsmyth/pages/timers7.html
http://www.edaboard.com/thread90160.html
http://www.diyaudio.com/forums/class-d/148287-doing-class-d-amp-project-using-tl494.html
Other than that the datasheets are probably teh first port of call:
http://www.ti.com/lit/ds/symlink/tl494.pdf
http://www.irf.com/product-info/datasheets/data/ir2110.pdf
Regards
Nick C.
Cardiff University -
How to connect java with oracle
can any body show me the code of how to connect java with oracle database.
thank youTo configure Oracle JDBC:
1. Add Oracle JDBC JAR file classes12.zip or ojdbc14.zip to classpath.
2. Load and register the JDBC driver.
Class.forName("oracle.jdbc.driver.OracleDriver");
3. Obtain a connection:
String url="jdbc:oracle:thin:@<host>:1521:<database>
Connection con = DriverManager.getConnection(url,
"myLogin", "myPassword");
4. Create a SQL statement.
Statement stmt = con.createStatement();
5. Obtain a result set.
ResultSet rs = stmt.executeQuery(
"SELECT ..."); -
How to connect JSP with MySql Database?
HI All...
I want to know or How to connect Mysql with JSP or JSF any other software is available? please help me.....I want to know or How to connect Mysql
with JSP or JSF any other software isavailable?
please help me.....First you need to find 25 m of a CatV cable and...The DB files need to be located on the ninth device of a SCSI Daisy Chain with the total SCSI cable length being over 150 m (and the devices (and cables) need to be mix of Differential and Non-Differential).
Edit: And forget the terminator, who needs it? -
How to connect portal with msaccess database
we have to develop oracle portal applications with msaccess as a back end.how to connect portal to access.
thanks in anticipation.I want to know or How to connect Mysql
with JSP or JSF any other software isavailable?
please help me.....First you need to find 25 m of a CatV cable and...The DB files need to be located on the ninth device of a SCSI Daisy Chain with the total SCSI cable length being over 150 m (and the devices (and cables) need to be mix of Differential and Non-Differential).
Edit: And forget the terminator, who needs it? -
How to connect SPA112 with Fritzbox7490
Well thats the question:
how to connect SPA112 with (internatiuonal) FritzBox7490 to use the phone(s) There must be a way to connect phone1 or two with DSL/Tel on the FritzboxYou can plug two analogue phones directly to the FON1 and FON2 ports.
-
How i connect iBooks with itunes on my nas?
How i connect iBooks with itunes on my nas?
I have been suckered by this problem too. I had all my e-books, mostly PDFs, saved on my NAS and available in iTunes. I wanted to access them from my old iMac with OS X 10.6.8 and my new iMac with OS X 10.9. But when the files were moved to iBooks, they disappeared from the NAS and now I'm in a mess. Thanks, Apple :-(
-
How to connect Air with Thunderbolt?
How do I connect Air with Thunderbolt?
Bought Air in Oct 2011 and Thunderbolt today.
Does Mac OS X (10.6.5) work with Thunderbolt?
Do I need a special cable other than what came in box?Hey moxiedoggy,
Welcome to Apple Support Communities! It sounds like you want to use Target Display Mode to use your iMac as a second screen to your MacBook Air. Since your said your MacBook Air is from 2011, it should have the thunderbolt, and you can connect the two computers using the following instructions:
Use an iMac with Thunderbolt as a display
If you have an iMac with Thunderbolt, any other Mac with Thunderbolt can use it as a display. The iMac will play both the video and audio from the other Mac.
Connect the Thunderbolt cable to the Thunderbolt ports on each computer.
Make sure both Mac computers are turned on and awake.
Press Command (⌘)-F2 on the keyboard of the external display Mac.
If you want the external display Mac to play audio as well as video from the primary Mac, choose Apple menu > System Preferences, click Sound, and then click Output. Select the external display Mac from the list of devices.
You'll want to go over the requirements for using Target Display Mode here, along with other FAQs:
Target Display Mode: Frequently Asked Questions (FAQ)
http://support.apple.com/kb/ht3924
Take care,
David -
How to connect websocket with weblogic.
Hi,
Can anyone tell how to connect websocket of html5 with weblogic server. Currently i am doing this thing with webbit NettyWebServer.
thanks in advanceHi Shajon --
Unfortunately, we're not permitted to give specific release dates/estimates - the best I can offer is that FMW 12c (which will contain WLS 12.1.2) is due to ship in CY 2013.
I can probably provide you with the GlassFish chat example we have running on WLS (v.minor changes in API) to give you a sense of what it looks like.
-steve- -
HT1212 how to connect iTune with iPhone 5s
I want to know how to sync iTune with iPhone 5s. In other words myiPhone is locked out and I cannot open without connecting it with iTune. That s the
message my phone is giving mTry reading the article you linked from...
-
HT1430 how to connect iTune with iPhone 5s
I want to know how to sync iTune with iPhone 5s. In other words myiPhone is locked out and I cannot open without connecting it with iTune. That s the
message my phone is giving me. Thanksconnect phone to computer
launch itunes
follow the prompts. -
How to connect APEX with MYSQL via Apex's Database link
How do i connect APEX with MYSQL via Apex's Database link? The OBE doesn't go into specific detail about how to link the two.
can someone please elaborate on what these are and where i can find them in mysql:
Database Link Name
Connect To Schema
Password
Remote Hostname or IP
Remote Host Port
SID or Service Name
I need to link to mysql database so I can set up a 3D pie chart in apexHi jononioo
A database link is a device for connecting between Oracle database instances only. Oracle does have a method for connecting to other database systems (Transparent Gateway) but this is restricted to other commercial databases and I don't believe there is a gateway for Mysql. (I could be wrong)
I don't know Mysql but maybe there is some way to push data to the Oracle instance. Other than that, is there any reason why the data has to reside in the Mysql database?
Regards
Andre -
Plz help....
How to Connect a Java With C ....using the JNI, Java Native Interface. there are tons of tutorials on the web about it, that will explain far better and more completely than a few posts on a forum
-
How to Connect Oracle with Crystal Reports
Hi Everyone,
I am new to Crystal Report,
Just tell me how to connect Crystal Report thro' Oracle 9i or 10g Forms
With regards,
KrishnanYou may want to use ODBC for the connectivity.
Maybe you are looking for
-
Maintenance view does not bring the default language in the Text table
Hi Experts, I am creating a maintenance view with the join of two tables TAB1 has following fields MANDT CATEGORY TAB2 (is the text table for TAB1) has the following fields MANDT LANGU CATEGORY DESCRIPTION I have created the maintenance view with MAN
-
Unhappy Face and Not Working Disk Mode
I am getting an unhappy face when i try to open my ipod, my windows doesnt recognize the ipod also. So I decided to run in disk mode and restore the Apple Software. The problem is when I run my iPod in Disk Mode and when I connect it, my iPod reboots
-
Hello All I have a wage type in W1 of payment in Pay slip Requirement is without affecting the property of the Wage type we need to just include a – sign in front of the number (amount). For example Now it is appearing as Leopard pay 10 But we want a
-
Mon ipod 5 ne s'allume plus/My ipod 5 will not turn on
Bonjour à tous, étrangement mon ipod 5 ne s'allume plus, ne charge plus et mon iTunes ne le reconnait également pas. Histoire Ce matin mon ipod 5 marchait parfaitement, puis je suis rentrer du travail et j'ai déposé mon ipod 5 sûr mon bureau d'ordina
-
Total Quantity generated from Process Order
Dear Experts, Can you help me on how to find the total quantity generated from process order. Example: I want to see for a particular material what is the total quantity converted in COR6N for a particular period. Thanks