Can Jsp build 2 connections at the same time?

Hi,
Can I make 2 connections with 2 different databases at the same time?
I mean, I need to take 1 value from 1st databases and 1 more value from 2nd database and need to print them on the page.
So, can I use a code segment like below ?
======================================================
                    // builiding connection with 1st database using dsn
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection con = DriverManager.getConnection(dsn,uid,pwd);
Statement st = con.createStatement();
idsql="select max(id)+1 id from table";
ResultSet idrs=st.executeQuery(idsql);
if (idrs.next())
     idref=idrs.getString("id");
     if (idref == null)
          idref = "1";
else
     idref = "1";
session.putValue("id",idref);
                    // building connection with 2nd database using dsn1
Connection con1 = DriverManager.getConnection(dsn1,uid,pwd);
Statement st1 = con.createStatement();
idsql1="select seq_id.nextval tempid from dual";
ResultSet idrs1=st1.executeQuery(idsql1);
idref1="1";
idref1=idrs1.getString("tempid");
sql1 = "insert into table (id2) values(" + idref1 + ")";
st1.executeUpdate(sql1);======================================================
Thanks in Advance ..

I am building two separate connections to different databases but I'm doing it a little differently using a bean.
example, in JSP, I have
<%@ page import="beans.*" %>
<jsp:useBean id="menu" class="beans.Menus"></jsp:useBean>
<%
String userProgs = menu.getUserPrograms;
String prodId = menu.getProductId;
%>

Similar Messages

  • Can I use both Wifi and a Lan connection at the same time?

    With me back in the dorms I have been limited to a slower connection than what I would like. Now we are able to use both Wifi and a Lan line so I was wondering to somewhat "double" my speed if there was any way to use both connections at the same time.
    Now I know that you can have both plugged in at the same time, I guess what I'm asking is, is there a way that I could set programs to use one or the other? Or some kind of virtual desktop that is set to use the other connection or anything that would allow both be used at the same time.
    Or am I just wishing for something that doesn't have any possible way to work?
    -nathan
    MacBook pro 2.16 C2D 2gb ram   Mac OS X (10.4.8)  

    You can use both at the same time, but not gor Internet access if that's what you're asking.
    Now there is a thing called Link Aggregation, which combines a number of interfaces for speed/redundancy, but it really only works locally, and then only with ALL special equipment in the route, and most likely OSX Server involved.
    Sorry.

  • Can't i use xml schema and oledb data connection at the same time?

    Hello to all and thanks in advance.I use xml schema and oledb data connection at the same time and the problem is that when I try to export the xml, the outcome is not what i expect.Without the oledb connection everything is ok (just the schema) and the xml complies with the schema.
    Can't i have both schema and oledb and the exported xml be as i want it?

    You can use both at the same time, but not gor Internet access if that's what you're asking.
    Now there is a thing called Link Aggregation, which combines a number of interfaces for speed/redundancy, but it really only works locally, and then only with ALL special equipment in the route, and most likely OSX Server involved.
    Sorry.

  • Can I turn off the wireless and use the wired connections at the same time?

    Can I turn off the wireless and use the wired connections at the same time?
    This is to avoid transmission when I work without the need for wireless

    Yes, you can. Just open the web interface of the router. On your browser type the IP address of your router, usually http://192.168.1.1 go to wireless tab and disable it.

  • Can I shuffle two playlists at the same time?

    How can I shuffle two playlists at the same time?  Thank you.

    You can only connect to one site at a time.  And you need to edit files locally, save & then upload to the remote server.   AFAIK, no single FTP app is capable of connecting to more than one server at a time.  You might be able to do what you want with DW open and an additional 3rd party FTP client like Filezilla, each connecting to different servers.
    Nancy O.

  • Wired and Wifi has to be connected at the same time to not be disconnected!

    I work as a tester for WoW and for the past few months, I’ve had connection issues. I’ve had Comcast come out a few times and they are so eager to leave they look up the speed and say, “Oh you are good on speed” well I’m not. Every few mins I’m disconnected from the server. It’s not my computer and I’ve done every thing WoW suggested. The ONLY way I’m able to stay online for an hour is I have to have the wired and WiFi connected at the same time on my desktop. If you have any suggestions let me know.

    I have posted this many, many times here. See if this helps you understand how this process works with regard to system sounds and screen rotation lock.
    System sounds can be muted and controlled two different ways. The screen lock rotation can be controlled in the same manner as well.
    Settings>General>Use Side Switch to: Mute System sounds. If this option is selected, the switch on the side of the iPad above the volume rocker will mute system sounds.
    If you choose Lock Screen Rotation, then the switch locks the screen. If the screen is locked, you will see a lock icon in the upper right corner next to the battery indicator gauge.
    If you have the side switch set to lock screen rotation then the system sound control is in the control center if you are running iOS 7. Swipe up from the bottom of the screen to get to control center . Tap on the bell icon and system sounds will return.
    If you are running iOS 5 or iOS 6, the system sound control is in the task bar at the bottom. Double tap the home button and swipe all the way to the right in the task bar to get to the speaker icon on the left side. Tap on that and the sounds will return.
    If you have the side switch set to mute system sounds, then the screen lock can be accessed in the same manner as described above.
    This support article from Apple explains how the side switch works.
    http://support.apple.com/kb/HT4085

  • 2 wireless connections at the same time

    Hi !
    First, sorry for my english, i am french....(yeah i know i know....)
    Let me explain my problem. I have at home a Macbook pro with Snow Leopard 10.6.7, a time capsule (1To) and a modem/router netgear. It's a big house so my Netgear modem/router in antoher room.
    I would like to use my Time capsule only as an external hard drive (wireless) to have the maximum power of data transmission with the norm 802.11n. I know this norm don't have a lot of range ( 5 meters...)
    How can i configure my time capsule to do that ?
    Will i be able to connect at the same time (with my Macbook pro) to my time capsule (on 802.11n)  and keep my internet connection active ( 802.11 G) through my Netgear router ?
    I want to do that just because my router Netgear is to far away from my macbook pro to use the  802.11n with time capsule. So if connect the time capsule to the netgear via ethernet, i loose a lot of power for the data transmission (too slow the see movie etc, backup copy etc..).
    I hope you understand me and it will be very nice to you to help me.
    Thanks !

    Hi Tesserax
    Thanks for the reply, sorry maybe I didn't explain my idea. I don't want to connect the Airport Express to the router well certainly not via a cable. I want to have the Airport Express basically be a hub for a printer and a couple of external hard drives and not be attached to a modem. I want to try and keep the current modem/router configuration I have, if possible. Therefore I'm asking whether I can have a wireless connection to the router for internet access and a separate connection to the Airport Express for the printer/hardrives. If this is not possible that's ok.
    Thanks again

  • 2 network connections at the same time

    I have 2 network connections at the same time. One for network shares and one for internet. How can I decide which connection should be used for which service?

    David684,
    Thanks for posting all of this.  I have a similar network question with a very similar setup that I am using with two interfaces. However, I am much less comfortable with the command line than you appear to be (although comfortable enough to crib little tweaks from the web and run them).
    The real difference is the resources I'm after and it seems like more of a problem. In my case, I'm running my home wireless network and can connect at decent speeds, but I happen to live right across from campus where I am attending grad school and I'm picking up the school wifi network. Having direct access to this network, among other things, allows me to access library research journals and databases from home without constantly needing to authenticate. But it isn't nearly enough to accomodate all of my network needs. The key difference, then, is the fact that these come in the form of websites. But I want to access only library stuff over that we-fi connection and do everything else from the LAN.  I use an app called papers for research, which has a built in web browser to allow me to pull up articles and then save them. Would that help me by allowing me to have just that program use wi-fi? I am not sure if the app is using an embedded safari session or it's own home-rolled browser, or how to check in the first place (OR if that makes a difference as far as being able to route the app's traffic to that interface). Also, with all of that said, how could I find out the subnets over which to route this if what I'm going after is a far less tangible resource than an SMB share? I am guessing I need a different method or that none exist?
    Thanks

  • Can you opening multiple albums at the same time in Photo (not iPhoto)?

    When converting the iPhoto library to Photo most of the albums that were in place in iPhoto converted to albums in Photo . . . .but not all. Some were retained as events mainly those that were folders within an album. In order to move them to the right album I would like to have multiple albums open at the same time (side by side) so that I can make sure not to duplicate photos or move them to the wrong spot.
    I cant see how to do this, it seems that I can need to open one album and check phots and then close to look within and other and rely on memory. There must be a more efficient and accurate way to do this?

    All of the events in iPhoto were converted to albums and are located in the Folder titled iPhoto Event in the sidebar of Photos. 
    You can't open multiple albums at the same time.  You can create a smart album that will do essentially the same thing with the following criteria:
    Album is "A"
    Album is "B".
    The smart album will display all of the photos in those two albums.

  • In Elements 7.0, how can I delete multiple photos at the same time?

    In Adobe Photoshop Elements 7.0, how can I delete multiple photos at the same time?   Please be a little specific so I can follow your instructions as I'm not real smart at computers; I'm an intermediate user.  Thank you.

    Shift-click the photos or Ctrl-click them to select them, then right-click one of them and choose Delete from Catalog. They will all go together.

  • TS4020 I live in a house with multiple iCloud users.  When they try to turn on "Find my computer"  they get the message that they will have to disable my "find my computer" setting in order to enable theirs.  How can they all be enabled at the same time?

    I live in a house with multiple iCloud users.  When they try to turn on "Find my computer"  they get the message that they will have to disable my "find my computer" setting in order to enable theirs.  How can they all be enabled at the same time?

    Try this support document for information on how to contact Apple and account security. Apple ID: Contacting Apple for help with Apple ID account security

  • How can I unlock numerous files at the same time (i.e. photos) so I can make changes (rotate etc)?

    Im using Lion on a MacBook Pro 15in (just under two years old) and I would like to know if I can lock numerous photo files at the same time so I can make changes to them. At the moment when I select an entire folder to go through and make changes, ie rotate in Preview, I am told with each photo that I have to unlock it. I am going through photos I took of archival material and have nearly 5000 photos to adjust and make changes to. This small step is taking up a lot of time.
    I realise there will probably be a common 'sense' answer to this but it alludes me at the moment so any help would be appreciated.
    Thanks

    Try this: https://addons.mozilla.org/en-US/firefox/addon/fox-splitter/?src=ss
    OR, open a second Firefox window (''Firefox button > New tab > New Window'' or ''Ctrl+N''), load the second site, resize windows side by side.
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You may need to update some plug-ins. Check your plug-ins and update as necessary:
    *Plug-in check --> http://www.mozilla.org/en-US/plugincheck/
    *Adobe Shockwave for Director Netscape plug-in: [https://support.mozilla.com/en-US/kb/Using%20the%20Shockwave%20plugin%20with%20Firefox#w_installing-shockwave Installing ('''''or Updating''''') the Shockwave plugin with Firefox]
    *'''''Adobe PDF Plug-In For Firefox and Netscape''''': [https://support.mozilla.com/en-US/kb/Using%20the%20Adobe%20Reader%20plugin%20with%20Firefox#w_installing-and-updating-adobe-reader Installing/Updating Adobe Reader in Firefox]
    *'''''Shockwave Flash''''' (Adobe Flash or Flash): [https://support.mozilla.com/en-US/kb/Managing%20the%20Flash%20plugin#w_updating-flash Updating Flash in Firefox]
    *Next Generation Java Plug-in for Mozilla browsers: [https://support.mozilla.com/en-US/kb/Using%20the%20Java%20plugin%20with%20Firefox#w_installing-or-updating-java Installing or Updating Java in Firefox]

  • My Apple ID and rescue email are reversed. How can I change them both at the same time

    My Apple ID and rescue email are reversed. How can I change them both at the same time?

    I'd already used this standard tool (exhaustively!), but for the problem encountered it operated in Catch 22 mode - you had to do two things but neither order was permitted. I did find an answer eventually, but am not sure what it was I did that solved it! Thanks, anyway.

  • On I-Mac, how can I close all tabs at the same time?

    On I-Mac, how can I close all tabs at the same time?
    I use Mozilla Firefox for internet.

    Not an Apple product, have you visited:
    https://support.mozilla.org/en-US/kb/keyboard-shortcuts-perform-firefox-tasks-qu ickly

  • How can I run  other applications at the same time as downloading email

    When I open my computer if I check mail on entourage first and there are 30+ messages I can not use other apps at the same time as the mail is downloading, is there a way to have email operating in the background. Curiously if I am using another application and a mail comes in , the first app runs with mail running in the background , Why is this not the case when Entourage is the first program running and it is downloading mail.

    http://www.officeformac.com/ProductForums/Entourage/ Alternatively, don't launch it at login, launch it after logging in.

Maybe you are looking for