I have setup JSP & MySQL but how can i Connect it to eche other ?
I feel sory by asking this qustion but i tried very enough
100 mile start from 1 mile ^_^
I have tested JSP files by http://localhost:8080/test.jsp
and it works very will
also i have already installd MySQL and i can create databases and tables by http://localhost/phpMyAdmin
so what i have to do else to connect JSP to MySQL ? , ( if nothing )
how can i test that MySQL Connected with JSP, so that i can display data from database ?
Best Regards
JMalik
create a java bean, which is just similar to a java class and put the database connection there so you wouldn't have to include that code in all you jsps everytime you connect to the database
this is for DbConnection.java
package connection;
import java.sql.*;
import java.io.*;
public class DBConnection
private Connection con;
public DBConnection()
try
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://localhost/yourfolder?user=yourusername&password=yourpassword");
catch (Exception e)
e.printStackTrace();
public Connection getConnection()
return con;
public void close()
try
con.close();
catch(Exception e)
e.printStackTrace();
}in another bean/class which connects to your database,
say for example this is SelectUsers.java
public String[] selectActiveUsers(int id) throws Exception, SQLException
try
con = new DBConnection().getConnection();
Statement stmt = con.createStatement();
String ins = "<your select statement>";
stmt.executeUpdate(ins);
con.close();
stmt.close();
catch (SQLException se)
System.out.println("SQL Exception: " + se.getMessage() + "not connected");
se.printStackTrace(System.out);
}and in your jsp, instantiate the class
users.jsp
SelectUsers su = new SelectUsers();
String[] users = su.selectActiveUsers(1);got it?
Message was edited by:
shuini
Similar Messages
-
My HD TV has two HDMI inputs which are being used by a home theater system and my RCN cable box. i want to be able to use my appleTV as well as those but do not have another HDMI input. How can i connect it so that i can use any 1 of the 3 at any time?
Get an HDMI switcher. Plug in the ATV directly to the TV and then use the switcher on the other input.
Example
http://www.amazon.com/Ultra-High-Performance-Switcher-Switch/dp/B0015YWKYY/ref=s r_1_1?ie=UTF8&qid=1316918064&sr=8-1 -
How can i connect iphone 4 with other mobile through bluetooth
how can i connect iphone 4 with other mobile through bluetooth
You can't. iPhone does not have this feature.
Some iOS apps will allow you to connect to other iOS devices for peer-to-peer games, or sending photos, but not to other makes of phone. -
I have flash media server but how can i open port 1935
how would i open
Port 1935 on my server as i think this is why my streaming in flash med
ia server does not workThis is my port details from command prompt Microsoft Windows [Version 6.1.7600] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\Administrator>netstat Active Connections Proto Local Address Foreign Address State TCP 127.0.0.1:11110 WIN-L969VFMO5GO:49242 ESTABLISHED TCP 127.0.0.1:19350 WIN-L969VFMO5GO:49167 ESTABLISHED TCP 127.0.0.1:19350 WIN-L969VFMO5GO:49243 ESTABLISHED TCP 127.0.0.1:49167 WIN-L969VFMO5GO:19350 ESTABLISHED TCP 127.0.0.1:49242 WIN-L969VFMO5GO:11110 ESTABLISHED TCP 127.0.0.1:49243 WIN-L969VFMO5GO:19350 ESTABLISHED TCP 192.168.1.65:1111 WIN-L969VFMO5GO:50394 ESTABLISHED TCP 192.168.1.65:1935 WIN-L969VFMO5GO:50371 ESTABLISHED TCP 192.168.1.65:1935 WIN-L969VFMO5GO:50393 ESTABLISHED TCP 192.168.1.65:1935 WIN-L969VFMO5GO:50395 ESTABLISHED TCP 192.168.1.65:1935 WIN-L969VFMO5GO:50398 ESTABLISHED TCP 192.168.1.65:1935 WIN-L969VFMO5GO:51012 ESTABLISHED TCP 192.168.1.65:1935 WIN-L969VFMO5GO:51091 ESTABLISHED TCP 192.168.1.65:49230 a92-123-153-19:http CLOSE_WAIT TCP 192.168.1.65:49231 a92-123-153-83:http CLOSE_WAIT TCP 192.168.1.65:50371 WIN-L969VFMO5GO:1935 ESTABLISHED TCP 192.168.1.65:50393 WIN-L969VFMO5GO:1935 ESTABLISHED TCP 192.168.1.65:50394 WIN-L969VFMO5GO:1111 ESTABLISHED TCP 192.168.1.65:50395 WIN-L969VFMO5GO:1935 ESTABLISHED TCP 192.168.1.65:50396 192.150.8.200:https CLOSE_WAIT TCP 192.168.1.65:50398 WIN-L969VFMO5GO:1935 ESTABLISHED TCP 192.168.1.65:51012 WIN-L969VFMO5GO:1935 ESTABLISHED TCP 192.168.1.65:51091 WIN-L969VFMO5GO:1935 ESTABLISHED TCP 192.168.1.65:51412 text:http TIME_WAIT TCP 192.168.1.65:51413 text:http TIME_WAIT TCP 192.168.1.65:51416 bits:http TIME_WAIT TCP 192.168.1.65:51417 bits:http TIME_WAIT TCP 192.168.1.65:51418 bits:http TIME_WAIT TCP 192.168.1.65:51419 bits:http TIME_WAIT TCP 192.168.1.65:51421 bits:http TIME_WAIT TCP 192.168.1.65:51425 bits:http TIME_WAIT TCP 192.168.1.65:51432 text:http CLOSE_WAIT TCP 192.168.1.65:51433 bits:http TIME_WAIT TCP 192.168.1.65:51438 bits:http TIME_WAIT TCP 192.168.1.65:51439 bits:http TIME_WAIT TCP 192.168.1.65:51444 w2:http ESTABLISHED TCP 192.168.1.65:51445 ww-in-f149:http ESTABLISHED TCP 192.168.1.65:51447 mpr5:http TIME_WAIT TCP 192.168.1.65:51450 wy-in-f144:http ESTABLISHED TCP 192.168.1.65:51451 ir1:http ESTABLISHED TCP 192.168.1.65:51452 mpr6:http TIME_WAIT TCP 192.168.1.65:51453 ir1:http ESTABLISHED TCP [fe80::7800:6e:735:c444%13]:3389 pc-PC:49161 ESTABLISHED C:\Users\Administrator>ping 192.168.1.65 Pinging 192.168.1.65 with 32 bytes of data: Reply from 192.168.1.65: bytes=32 time<1ms TTL=128 Reply from 192.168.1.65: bytes=32 time<1ms TTL=128 Reply from 192.168.1.65: bytes=32 time<1ms TTL=128 Reply from 192.168.1.65: bytes=32 time<1ms TTL=128 Ping statistics for 192.168.1.65: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms C:\Users\Administrator>netstat -a Active Connections Proto Local Address Foreign Address State TCP 0.0.0.0:80 WIN-L969VFMO5GO:0 LISTENING TCP 0.0.0.0:135 WIN-L969VFMO5GO:0 LISTENING TCP 0.0.0.0:445 WIN-L969VFMO5GO:0 LISTENING TCP 0.0.0.0:1111 WIN-L969VFMO5GO:0 LISTENING TCP 0.0.0.0:1935 WIN-L969VFMO5GO:0 LISTENING TCP 0.0.0.0:3389 WIN-L969VFMO5GO:0 LISTENING TCP 0.0.0.0:6515 WIN-L969VFMO5GO:0 LISTENING TCP 0.0.0.0:8134 WIN-L969VFMO5GO:0 LISTENING TCP 0.0.0.0:47001 WIN-L969VFMO5GO:0 LISTENING TCP 0.0.0.0:49152 WIN-L969VFMO5GO:0 LISTENING TCP 0.0.0.0:49153 WIN-L969VFMO5GO:0 LISTENING TCP 0.0.0.0:49154 WIN-L969VFMO5GO:0 LISTENING TCP 0.0.0.0:49155 WIN-L969VFMO5GO:0 LISTENING TCP 0.0.0.0:49163 WIN-L969VFMO5GO:0 LISTENING TCP 0.0.0.0:49164 WIN-L969VFMO5GO:0 LISTENING TCP 127.0.0.1:9421 WIN-L969VFMO5GO:0 LISTENING TCP 127.0.0.1:9422 WIN-L969VFMO5GO:0 LISTENING TCP 127.0.0.1:9423 WIN-L969VFMO5GO:0 LISTENING TCP 127.0.0.1:11110 WIN-L969VFMO5GO:0 LISTENING TCP 127.0.0.1:11110 WIN-L969VFMO5GO:49242 ESTABLISHED TCP 127.0.0.1:19350 WIN-L969VFMO5GO:0 LISTENING TCP 127.0.0.1:19350 WIN-L969VFMO5GO:49167 ESTABLISHED TCP 127.0.0.1:19350 WIN-L969VFMO5GO:49243 ESTABLISHED TCP 127.0.0.1:49167 WIN-L969VFMO5GO:19350 ESTABLISHED TCP 127.0.0.1:49242 WIN-L969VFMO5GO:11110 ESTABLISHED TCP 127.0.0.1:49243 WIN-L969VFMO5GO:19350 ESTABLISHED TCP 169.254.196.68:139 WIN-L969VFMO5GO:0 LISTENING TCP 192.168.1.65:139 WIN-L969VFMO5GO:0 LISTENING TCP 192.168.1.65:1111 WIN-L969VFMO5GO:50394 ESTABLISHED TCP 192.168.1.65:1935 WIN-L969VFMO5GO:50371 ESTABLISHED TCP 192.168.1.65:1935 WIN-L969VFMO5GO:50393 ESTABLISHED TCP 192.168.1.65:1935 WIN-L969VFMO5GO:50398 ESTABLISHED TCP 192.168.1.65:1935 WIN-L969VFMO5GO:51012 ESTABLISHED TCP 192.168.1.65:1935 WIN-L969VFMO5GO:52277 ESTABLISHED TCP 192.168.1.65:1935 WIN-L969VFMO5GO:52388 ESTABLISHED TCP 192.168.1.65:49165 WIN-L969VFMO5GO:0 LISTENING TCP 192.168.1.65:50371 WIN-L969VFMO5GO:1935 ESTABLISHED TCP 192.168.1.65:50393 WIN-L969VFMO5GO:1935 ESTABLISHED TCP 192.168.1.65:50394 WIN-L969VFMO5GO:1111 ESTABLISHED TCP 192.168.1.65:50396 192.150.8.200:https CLOSE_WAIT TCP 192.168.1.65:50398 WIN-L969VFMO5GO:1935 ESTABLISHED TCP 192.168.1.65:51012 WIN-L969VFMO5GO:1935 ESTABLISHED TCP 192.168.1.65:52277 WIN-L969VFMO5GO:1935 ESTABLISHED TCP 192.168.1.65:52319 a92-123-153-19:http CLOSE_WAIT TCP 192.168.1.65:52388 WIN-L969VFMO5GO:1935 ESTABLISHED TCP 192.168.1.65:52592 wy-in-f157:http ESTABLISHED TCP 192.168.1.65:52593 wy-in-f157:http ESTABLISHED TCP 192.168.1.65:52612 ww-in-f155:http ESTABLISHED TCP 192.168.1.65:52619 ww-in-f102:http ESTABLISHED TCP 192.168.1.65:52620 a92-123-153-25:http ESTABLISHED TCP 192.168.1.65:52626 a92-123-153-81:http ESTABLISHED TCP 192.168.1.65:52717 fe:http TIME_WAIT TCP 192.168.1.65:52720 91.103.142.194:http ESTABLISHED TCP 192.168.1.65:52722 a92-123-153-10:http ESTABLISHED TCP 192.168.1.65:52724 a92-123-153-10:http ESTABLISHED TCP 192.168.1.65:52725 a92-123-153-10:http ESTABLISHED TCP 192.168.1.65:52726 a92-123-153-10:http ESTABLISHED TCP 192.168.1.65:52729 65.242.27.32:http TIME_WAIT TCP 192.168.1.65:52730 65.242.27.32:http TIME_WAIT TCP 192.168.1.65:52732 ww-in-f102:http ESTABLISHED TCP 192.168.1.65:52734 64.236.76.160:http ESTABLISHED TCP 192.168.1.65:52739 ec2-79-125-122-81:http ESTABLISHED TCP 192.168.1.65:52740 95.101.16.74:http ESTABLISHED TCP 192.168.1.65:52741 mpr2:http TIME_WAIT TCP 192.168.1.65:52742 ec2-79-125-28-85:http TIME_WAIT TCP 192.168.1.65:52744 a92-123-153-9:http ESTABLISHED TCP 192.168.1.65:52745 mpr2:http TIME_WAIT TCP 192.168.1.65:52746 wy-in-f156:http ESTABLISHED TCP 192.168.1.65:52747 a92-123-153-82:http ESTABLISHED TCP 192.168.1.65:52749 64:http TIME_WAIT TCP 192.168.1.65:52757 64:http TIME_WAIT TCP 192.168.1.65:52760 mpr2:http TIME_WAIT TCP 192.168.1.65:52761 ec2-79-125-28-85:http TIME_WAIT TCP 192.168.1.65:52763 mpr2:http TIME_WAIT TCP 192.168.1.65:52764 64:http TIME_WAIT TCP 192.168.1.65:52770 194.129.79.23:http TIME_WAIT TCP 192.168.1.65:52774 mpr2:http TIME_WAIT TCP 192.168.1.65:52776 mpr2:http TIME_WAIT TCP 192.168.1.65:52782 mpr2:http TIME_WAIT TCP 192.168.1.65:52783 ec2-79-125-28-85:http TIME_WAIT TCP 192.168.1.65:52785 mpr2:http TIME_WAIT TCP [::]:135 WIN-L969VFMO5GO:0 LISTENING TCP [::]:445 WIN-L969VFMO5GO:0 LISTENING TCP [::]:3389 WIN-L969VFMO5GO:0 LISTENING TCP [::]:47001 WIN-L969VFMO5GO:0 LISTENING TCP [::]:49152 WIN-L969VFMO5GO:0 LISTENING TCP [::]:49153 WIN-L969VFMO5GO:0 LISTENING TCP [::]:49154 WIN-L969VFMO5GO:0 LISTENING TCP [::]:49155 WIN-L969VFMO5GO:0 LISTENING TCP [::]:49163 WIN-L969VFMO5GO:0 LISTENING TCP [::]:49164 WIN-L969VFMO5GO:0 LISTENING TCP [fe80::7800:6e:735:c444%13]:3389 pc-PC:49161 ESTABLISHED UDP 0.0.0.0:53 *:* UDP 0.0.0.0:500 *:* UDP 0.0.0.0:3702 *:* UDP 0.0.0.0:3702 *:* UDP 0.0.0.0:4500 *:* UDP 0.0.0.0:5355 *:* UDP 0.0.0.0:6514 *:* UDP 0.0.0.0:50854 *:* UDP 0.0.0.0:50856 *:* UDP 0.0.0.0:50858 *:* UDP 0.0.0.0:56952 *:* UDP 127.0.0.1:49293 *:* UDP 127.0.0.1:50781 *:* UDP 127.0.0.1:50855 *:* UDP 127.0.0.1:53143 *:* UDP 127.0.0.1:58363 *:* UDP 127.0.0.1:58653 *:* UDP 127.0.0.1:59769 *:* UDP 127.0.0.1:63390 *:* UDP 127.0.0.1:64492 *:* UDP 169.254.196.68:137 *:* UDP 169.254.196.68:138 *:* UDP 192.168.1.65:137 *:* UDP 192.168.1.65:138 *:* UDP [::]:500 *:* UDP [::]:547 *:* UDP [::]:3702 *:* UDP [::]:3702 *:* UDP [::]:4500 *:* UDP [::]:5355 *:* UDP [::]:50857 *:* UDP [::]:50859 *:* UDP [::]:56953 *:* UDP [fe80::b0e8:29cf:aafb:800c%11]:53 *:* C:\Users\Administrator>
-
How can I connect my MBP to other devices?
Hello,
I have a Yamaha DVD Receiver ("Natural Sound", RDX-E700) and would like to connect it to my MBP so I can hear the my music from iTunes through the loudspeakers connected to the DVD Receiver. Every time I try it doesn't work, even if I switch to AUX mode or whatever... I have a cable which allows me to do so on the big TV and DVD player (also Yamaha), but not on my little Yamaha.
Can you help me?
Thanks
MCH
from Italy :-)Contact the manufacturer to make sure you meet all of the system requirements.
-
How can I connect to more than one computer from external ip
Hi
I have been using remote desktop for some time and have a port forward set so I can connect to our mail server from anywhere else externally from my macbook pro, but how can I connect to other macs in the office when there only seems to be the two ports available for use 5900 and 3283. I can only port forward to one computer? How can I connect to multiple computers when not within the same network? are there other ports available?
Cheers
TonyIf your workstations get their addresses from an NAT device rather than being "real", the ports also need to be forwarded in the router to the workstation's internal IP address. ARD uses port 3283 for the reporting and updating function, so if your Macs are getting their IP addresses through NAT, since you can only forward a port to a single workstation, you can only get reports, push package/files to etc. for a single workstation.
ARD uses the VNC protocol for observation and control, though, and there are a range of IP addresses for that protocol, starting with 5900. ARD uses 5900 by default, so that port would be forwarded to the first workstation. You would, I believe, need to install third-party VNC software on the systems (since the ARD client cannot listen on any port other than 5900 while other VNC systems can be set for other ports such as 5901, 5902, etc. You would then forward 5901 to the second workstation (and on to 5902, 5903, etc.). You can then use the following information:
http://docs.info.apple.com/article.html?path=RemoteDesktop/3.0/en/ARDC715.html to connect.
The only other options are: 1) to run the ARD administrator on a workstation on the network, and then take control of that system from outside, either via VNC or another copy of ARD, or 2) set up a virtual private network (VPN) so that when you connect from outside, your admin system is officially part of the local network.
Hope this helps. -
Hi,
i have a running wlan network. In this network are a macbook pro, a Vista notebook and the time capsule. The Macbook runs perfectly with the time capsule, but how can I connect the vista machine with the time capsule?
Thanks for helpThe TC is SMB (windows networking protocol) compatible.
Is the issue wireless? Can you get internet via the TC?
Are you trying to access the hard disk?
Did you load the airport utility for windows..? If not please do so.. that at least is the first step. It loads bonjour for windows, and a connection agent.
Sometimes that is all that is required.
Open a windows explorer and type in the address bar
\\TCname or \\TCIPaddress .. obviously replacing the generic name with actual name or IP.
You might need to change all the names to SMB standard via the utility. Short no spaces pure alphanumeric.
You might need to fix the permissions.. ie turn on the guest account if security isn't an issue.
You might need to fix networking in the vista .. shudder.. notebook.. to ensure it is not blocking the TC. -
I just bought a new IMAC and I want to install the Office Mac 2011, but it doesn´t have a CD unit. How can I do it?
Howard has the easiest answer. Or at least, cheapest, since you don't need to purchase an external CD/DVD drive.
The "demo" software from Microsoft's site is exactly the same as what's on the DVD. Install that and activate it with the key in your software box.
From Microsoft's site:
How do I install Office for Mac 2011 if my Mac doesn't have a DVD drive?
There are two options for installing Office for Mac if your Mac doesn't have a DVD drive.
Option 1: Convert your Office for Mac 2011 trial. To convert a trial version, you must have a valid product key. The product key will convert your trial into a fully licensed version of Office for Mac.
1. Locate the 25-character product key in your product package or confirmation email.
2. Open any Office for Mac application, like Word, PowerPoint, or Excel.
3. On the first screen of the Microsoft Office Setup Assistant, click Enter your Product Key.
4. Enter your product key and complete the installation instructions.
Option 2: If you have not previously installed the trial version, you can download Office for Mac from the Office for Mac website. To download, install, and activate the software you must have a valid Office 2011 product key.
1. Locate your 25-character product key found in your product package or confirmation email.
2. Go to www.officeformac.com/download
3. Click Get Started to start the download process.
4. When prompted, enter your 25-character product key and select your product language.
5. When prompted, sign in with your Windows Live ID or sign up and create a new Windows Live ID account.
6. After you enter your Windows Live ID, you will see a link to download the software. (You will also receive a confirmation email with a link to your My Account page if you prefer to wait and download your software at a later time.)
7. Click Download Now to start the download.
8. Save the file to your desktop. Do not change the file name.
9. When the download is complete, double-click the .dmg file icon on your desktop. This opens the Installer application in Mac OS X.
10. Follow the instructions in the installer screens to complete your installation. -
How can I connect my 3gen apple tv with HDMI to my BUSH LCD32TV022HD
This does not have an HDMI port but does have:-
1) S-Video I/P,
2) Video I/P,
3) Audio Input (Left & Right)
4) Audio In jack (for VGA and DVI source)
5) DVI input
6) VGA inputWelcome to the Apple community.
The Apple TV doesn't officially support a DVI connection, however you may be able to get it to work. You will first need to check that your TV supports either 720p or 1080p as well as HDCP. If you are able to get the video working over the DVI connection, you may also require a DAC in order to connect with Apple TV's optical audio output to the TVs audio imput.
You may well wish to make sure that the DVI connection works before spending any money on a DAC.. -
I have photos I want to group together in one album, but can't do this because some may have the same number. How can I combine them all into one album? I was trying to move several albums onto a USB drive and it stated all other files exist at this location. They are pictures taken at different times and have the same number I guess.
In iPhoto albums may contain photos with the same file name - iPhoto handles that just fine
If you are exporting them to move somewhere else use the sequential file name feature of export to give each file a unique name
LN -
I do not have a home wifi setup. How can I connect my iMac to apple TV?
I do not have a home wifi setup. How can I connect my iMac to apple TV?
you need a wifi connection, it says on this manual
http://manuals.info.apple.com/MANUALS/1000/MA1607/en_US/apple_tv_3rd_gen_setup.p df -
How can I restore my data from iCal? I didn't make any backup, but I use time machine with an external HD. I deleted iCal when I deleted my gmail account. I have tried to restore, but I can only restore the iCal software and not the data.
So what is your question?
If you forgot your encryption password:
Warning: Make sure it's a password you will remember or write it down for safekeeping. If you encrypt an iPhone backup in iTunes and forget your password, you can't restore from backup and your data will be unrecoverable.
If you can't remember the password and want to start again, you must perform a full software restore and chooseset up as a new device when iTunes prompts you to select the backup from which to restore.
The above comes from here:
http://support.apple.com/kb/HT4946 -
2 different iphones have the same Apple ID, how can I change the apple ID on one of them but not delete the other iphone's data and media?
You don't have to do anything with the first iPod that you don't use anymore. If you are planning on keeping it, put in a drawer in your house and forget about it.
You don't need a second account to use with the new iPod. I use one Appl e ID and iTunes library for two iPods, and two iPad. I have different content on all four devices. You can select exactly what you want to sync to each device and it can be different content on all devices. -
I need to access my iphone but I have forgotten my password. How can I access my iphone?
You need to restore iPhone with iTunes on computer. Open iTunes on computer, connect iPhone to computer, hold both home and power buttons until iTunes recognizes iPhone in Recovery Mode. Click Restore button of iTunes.
-
need to add a program to my laptop, but I have forgotten my password. How can I reset it?
Solution may be found if you search in the "More Like This" section over in the right column.
Maybe you are looking for
-
Restoring after archive and install
after using 'archive and install', what is the proper procedure for restoring applications, plugins, etc? 1. manually copy? 2. migration assistant? 3. reinstall using disks/installers?
-
Hi, AS3: How to get general id (or) name from xml loaded images. bcoz, i want to drag and drop that images in generic method. Now, i currently used the event.target.name for each one. So, code length was too large. See my code below. /*********loadin
-
Open videos stored in iCloud drive
I have some exercises videos stored in my iCloud drive folder. How do I open those on my iPhone??
-
How do I create rules files in Sap Data Services
Hello Guys, I'm new with Bo Sap Development Data Services, and am migrating SSIS packages 2008 for the bods. I am studying the process of cleanup and word processing via bods. But I noticed that my installation does not have Rules Files. My question
-
How can i delete all modifications made by any distribution?
Such as search engines and keyword.url search - just get pure Firefox installation. It's very annoying and reinstallation doesn't help.