Access a method for a DB connection. HELP URGENT thnx

Hi I am trying to create a method in another class to call another method that checks for userid in DB? What is the best way to set this up? I.e. calling method?
//calling method below line
private boolean setuserExist(String username) {
     else return false;
public String getserExist() {
          return userexist;
// Method being called below this line
public boolean userExist(String username){
          boolean exist = false;
          System.out.println("in LoginDBAccess: username is " + username);
          try{
Connection conn = dbc.getConnection();
Statement statement = conn.createStatement();
String query =      "SELECT User.UserID " +
                    "FROM User " +
                    "WHERE User.UserID = '" + username + "'";
ResultSet resultSet = statement.executeQuery(query);
System.out.println("1.1");
ArrayList result = new ArrayList();
while(resultSet.next()){
     //System.out.println("In While:");
ArrayList item = new ArrayList();
item.add(resultSet.getString("UserID"));
result.add(item);
System.out.println("LoginDBAccess Count: " + result.size());
conn.close();
if (result.size() == 1){
     exist = true;
          }catch(Exception e){
     e.printStackTrace();
          return exist;
     }

The better question is I guess,
How do I use this code below to call the 2nd block of code or method?
private boolean setuserExist(String username) {
else return false;
public String getserExist() {
return userexist;
}// 2nd Method being called below this line
public boolean userExist(String username){
boolean exist = false;
System.out.println("in DB: username is " + username);
try{
Connection conn = dbc.getConnection();
Statement statement = conn.createStatement();
String query = "SELECT User.UserID " +
"FROM User " +
"WHERE User.UserID = '" + username + "'";
ResultSet resultSet = statement.executeQuery(query);
System.out.println("1.1");
ArrayList result = new ArrayList();
while(resultSet.next()){
ArrayList item = new ArrayList();
item.add(resultSet.getString("UserID"));
result.add(item);
System.out.println("DB Count: " + result.size());
conn.close();
if (result.size() == 1){
exist = true;
}catch(Exception e){
e.printStackTrace();
return exist;
}

Similar Messages

  • I have a ipod touch 2nd generation 8gb 4.2.1 im new to itunes i made a itunes account but it says i need a payment method is there anyway i can use my paypal if not is there a way to not have to use a payment method for itunes store please help ty

    i have a ipod touch 2nd generation 8gb 4.2.1 im new to itunes i made a itunes account but it says i need a payment method is there anyway i can use my paypal if not is there a way to not have to use a payment method for itunes store please help ty

    Create a NEW account using these instructions. Make sure you follow the instructions. Many do not and if you do not you will not get the None option. You must use an email address that you have not used with Apple before.
    Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card
    Using those instructions you may also be able to select PayPal if that is allowed in your country.

  • Direct Access 2012 -- method for disabling and re-enabling client access ?

    We have a reliably functioning DA 2012 setup (which is great), but I need a way to selectively Disable and later Re-Enable DA for particular clients. We use a security group for the Computer accounts of the clients and this is referenced both by Group Policy
    (to assign the right settings to the DA Clients) and by the DA Server (to grant the access).
    We had hoped that we could simply delete the client Computer account from the security group, but when we tried this the DA server seems to just ignore it, even after a reboot of the DA Server.
    We have looked all through the settings of the DA server to see if there is a "disconnect client" option, but can't find anything (which truly amazes me!).
    I have seen one blog post from Richard Hicks which recommends running some PowerShell commands (http://directaccess.richardhicks.com/2013/06/11/disconnecting-directaccess-clients-on-windows-server-2012)
    but after testing these it seems clear that this really only helps me in a scenario where (A) the client is offsite; and (B) I first Disable the Computer account in AD and then replicate AD.
    Wondering what my options are? What do I do when we want to Disable DA for a particular client and then turn it back on again some weeks later?

    When you remove the computer account from your group, it will stop DirectAccess from working, but only once the DA client machine receives it's next Group Policy refresh. The purpose of the group is to get those DirectAccess connectivity settings applied
    from the DA GPO. So if you remove the account, sometime over the next couple of hours Group Policy will refresh on that laptop, and the DirectAccess settings will be removed. If you do this, then later down the road when you want to turn DirectAccess back
    on, you'll need to get that laptop either back into the office or connected via some kind of VPN, because when you add the computer account back to the group, the client machine will have to receive the GPO settings all over again.
    I have been installing DirectAccess for years in tons of places, and I don't think I have ever heard of the business requirement to remove and re-add computers to DA like you are describing - do you mind sharing your reasoning behind this? (I'm just truly
    curious, I'm always interested in finding new ways that companies are using DA)
    The quickest way to disconnect a client machine from DirectAccess is to disable the computer account in AD. You could then re-enable the computer account later and DA would start working again, but of course if you leave a computer account disabled in Active
    Directory for a long period of time, it could cause other kinds of sync problems outside the scope of DA.
    DirectAccess, if designed properly, turns itself off whenever the computer is connected to the corp network, whether physically onsite or connected via another form of VPN. Given this behavior, I'm not sure why you would want to be able to disable DA for
    a while and then turn it back on again later...?

  • Method for backing up connection data?

    I am moving to a new workstation. I need a way to back up my
    connection data, because I manage multiple sites using Contribute
    and it's a pain to reestablish the dialing directory. Contribute
    does not appear to have an easy "export connections directory"
    function. Is there a file I can copy?

    A few other notes on backup and backup material. The previous article on DVD backup not withstanding, not all writable DVD's are equal. A very good article on this subject can be found here:
    http://adterrasperaspera.com/blog/2006/10/30/how-to-choose-cddvd-archival-media/
    Part of my other day job is IT administration at a small semiconductor company. We, like most other companies, do ALL of our backup to tape. Our tapes are not MiniDV but DLT's. We store all of our tapes off site in a environmentally controlled storage facility. I suspect you like me cannot afford something like this for our video work but at a minimum this does mean you should not stuff your tapes in a box and stick them in the attic.
    Another thing to note that backup means you should, at minimum, have 2 copies of your critical files on two different pieces of hardware. If you keep all of your project files on your working system disk in your Mac and a copy of those files on an external drive you are pretty safe in your backup. If you ONLY keep one copy on that external drive, you are playing with fire. Especially when it comes to hard drive. Hard drive failure is the numero uno failure mechanism in computers, followed by power supplies. It is not a question of if a drive is going to fail, simply when.
    For me, I run a RAID 5 1.2TB linux server on my home network. I keep my working files on my MacPro and backup to the server. I'm paranoid square so in addition to that, I back up my RAID to two 500GB portable external drives on a periodic basis. For me, hard drives and media is dirt cheap as opposed to trying to replace important data that is lost or in many cases, irreplaceable.

  • Cck, ipad and windows 7. no connection. help, urgent...

    hi
    I recently got a CCK. and it won't connect to windows7 anymore (64, up-to-date, brand new cck & usb cable)
    I tryed once yesterday and it worked (I could send some midi data). but now it's impossible to establish a connection. i didn't install anything between the moment it worked and the moment it didn't anymore. I just turned of the laptop.
    the ipad just doesn't show under "directory". I tried disabling the firewall, reinstalling bonjour & rtpmidi. nothing works.
    apparently when I plug the ipad something is also supposed to happen on windows (a pop up, the ipad showing somewhere). it is not the case, nothing happens at all.
    what could block the ipad+cck to be connected to windows ?
    thanks in advance

    http://hexler.net/docs/touchosc-configuration-connections-coremidi
    glad to make you discover alternative uses of the CCK
    anyway :
    according to this site windows is suppoed to recognize the ipad (as a usb peripheral) when plugged with the cck
    http://www.ipadforums.net/ipad-help/47509-transferring-photos-imported-ipad-my-c omputer-after-using-camera-connection-kit.html
    but on my computer it doesn't. nothing happens at all
    what could cause this ?

  • Best Method For Connection - JDev Team Help

    Hi,
    We are using a couple of different methods for obtaining a connection and pooling. I'm wondering what is the best method, though...if there is a preferred approach?
    One approach is getting the ApplicationModuleRef from the request. We then release the amref as true/true or true/false (pending of if we need to maintain state), but we definitely try to release true/false whenever possible.
    The other approach is using createRootApplicationModule. We then either release it back to the pool false or destroy it immediately w/ true.
    Is there a preferred approach between the two? We are constantly struggling with inactive sessions that are not getting cleaned up when they reach our timeout limit which is causing severe memory issues with our application. Is one of our methods for obtaining the connection and releasing perhaps causing our pooling issues?
    Any help on this would be greatly appreciated!
    Thanks!
    Andy Hamilton - TUSC

    That is exactly the problem and with 100+ users on the system at one time our connection count gets large quite rapidly. The issue only occurs though with sessions released true/true...they are never reused, just new connections piled on top.
    We are actually turning connection pooling on in hopes of it resolving our connection issues. Any idea though why if you release an amref true/true and then attempt to do a session.invalidate you would get this error:
    java.lang.NullPointerException     at oracle.jbo.server.DefaultTxnHandlerImpl.handleRollback(DefaultTxnHandlerImpl.java:125)     at oracle.jbo.server.DBTransactionImpl.doRollback(DBTransactionImpl.java:3417)     at oracle.jbo.server.DBTransactionImpl.rollback(DBTransactionImpl.java:1650)     at oracle.jbo.common.ampool.ApplicationPoolImpl.resetApplicationModule(ApplicationPoolImpl.java:885)     at oracle.jbo.common.ampool.ApplicationPoolImpl.removeSessionCookie(ApplicationPoolImpl.java:546)     at oracle.jbo.common.ampool.SessionCookieImpl.timeout(SessionCookieImpl.java:365)     at oracle.jbo.http.HttpSessionCookieImpl.timeout(HttpSessionCookieImpl.java:80)     at oracle.jbo.http.HttpContainer.fireTimeout(HttpContainer.java:516)     at oracle.jbo.http.HttpContainer.timeout(HttpContainer.java:241)     at oracle.jbo.http.HttpContainer.valueUnbound(HttpContainer.java:308)
    Thanks!
    Andy

  • Need to give access to users for report painter query without GR55

    Hi,
    I need to create a transaction code for a query created using report painter. We do  not want to give access to user for GR55.
    Please help us in achieveing this one or any other way to execute report without GR55 access.
    Regds,
    Servesh
    Moderator: Please, search before posting - it has been answered several times

    Hi,
    You can create the transaction the same using SE93 transaction code.
    Also see the below link for detailed rocess:-
    [http://home4sap.com/Blog/2009/08/how-to-create-a-transaction-code-for-report-painter-reports/]
    Regards,
    Gaurav

  • I forgot the code for my iPhone to access the Home screen I do , please help me try formatting the iphone but when I put in nfc mode and connect it to the pc recognizes it and everything when you try to format the error 3004 appears

    I forgot the code for my iPhone to access the Home screen I do , please help me
    try formatting the iphone but when I put in nfc mode and connect it to the pc recognizes it and everything when you try to format the error 3004 appears

    Hello polo-angulo,
    I apologize, I'm a bit unclear on the nature and scope of the issue you are describing. If you are saying that you are getting an error code (3004) when you try to restore your iPhone (because you could not remember your passcode), you may find the information and troubleshooting steps outlined in the following articles helpful:
    Resolve iOS update and restore errors in iTunes - Apple Support
    Get help with iOS update and restore errors - Apple Support
    Sincerely,
    - Brenden

  • I cannot retrieve the password for the wifi connection on my imac and so cannot access the internet with my ipad at home.  I have a cable modem. Help please!

    I cannot retrieve the password for the wifi connection on my imac and so cannot access the internet with my ipad at home.  I have a cable modem. Help please!

    If you mean that you cannot remember the password for your WiFi network this will work for you - or it should work if you are the administrator on the Mac.
    You will need to be logged in as the administrator on your Mac and you must know the password - Open Keychain Access on your Mac in the utilities folder, click on Passwords. Find the Airport Network Password listed on the right. Double click on it. Click on show password in the the window that pops up. Enter your administrator password when prompted and click allow.
    If Keychain is locked - you must enter the administrator password there as well to unlock it and access the password.
    If you have set the Mac up for Internet Sharing for the iPad to share the Mac's connection, just create a new network On the Mac with Internet sharing and a new password.

  • Authentication method for JCo connection in XSS installation

    Hi All,
    I have a query which perplexes me.  I am implementing XSS (ESS/MSS) on SAP Portal EP6 SR1 with an ECC5 backend for prototype purposes.
    When I follow SAP's help steps to setup JCo connections, it states that for the metadata connection you should use a security authentication method of 'User/Password', but for the application data connection you should use a security authentication method of 'Ticket'.
    Does anyone know why the difference in methods here?  Is it possible to use 'User/Password' for both?  Any thoughts would be appreciated.

    Hi john,
    User -ID /Pwd method can be used to access the backend for both types of Data as per your scenario.
    User -ID /Pwd method and logon tickets both can be used to access data in backend.
    The difference lies in the scenario with which you are accessing the back-end.
    If all your portal users are same as backend users then you can select Logon ticket methods.
    If they are going to be different then you need User-ID /Pwd method .
    Check the following link to get a clear picture:
    <a href="http://help.sap.com/saphelp_ep50sp2/helpdata/en/4d/dd9b9ce80311d5995500508b6b8b11/frameset.htm">Scenario to use type of SSO</a>
    Hope it helps.
    Regards,
    Vivekanandan

  • What is the direct connect method for transfering photos from my macbook pro to my iphone without using iTunes syncronization? (iow: a simple photo copy from mac to iphone?)

    I feel like I should know the answer to this. I can't believe it is a hard question.
    What is the direct connect method for transfering photos from my macbook pro to my iphone without using iTunes syncronization? (iow: a simple photo copy from mac to iphone?)
    Easy? Right?
    Just plug my iphone in to a mac and copy a photo from the mac to my iphone.
    I don't have internet access - I can't email it, or mobileme it, or dropbox it.

    iTunes. Other than that there is no direct method. However, do try the iPhone forums.

  • I have a time capsule connected directly to fiber connection. I have connected a windows server directly to TC and configured it for remote desktop connection. From my interanet I can access srvr but not from my home. What config I need on TC?

    I have a time capsule directly connected to fibre optic point out. All pcs and macs are connected wirelessly to the internet. I have connected a windows server pc to TC. When configured for Remote desktop connection, I can access windows server from within interanet but don't know how to access it from internet. I guess I need to change some settings in TC to get some ip adress for the remote desktop connection from my home. Anyone who can help me out? Appreciate it.
    Narmin

    I am a little lost now.. I have read again your title and your first post.. and they seem inconsistent.
    In the title you state.
    From my interanet I can access srvr but not from my home.
    Interanet is not a word I know.. I assumed intranet...are you talking about internet or intranet? And just to be clear say WAN or LAN.. !! Is your home part of the interanet??
    In the first post you state,
    I can access windows server from within interanet but don't know how to access it from internet.
    Now this is more normal.. the issue is not in the home at all, it is accessible from there but fails from internet. If this is correct, then you can do a few obvious things to determine where the problem is.
    But first I need to know are you actually testing from a different internet connection to your home lan.. you are not just trying the public IP from inside the LAN as that will fail due to the TC not doing NAT Loopback.
    I am also assuming the TC is the only router in the network, and has the public IP on the WAN interface.
    And I am also assuming you have turned on the ping responder and you can actually ping your public ip from the internet and get a response. This helps no end in figuring out where there are issues. Strange but I have no idea if there is a ping responder in the TC WAN so you might need to forward that as well. Also if you have a dynamic public ip address are you using dyndns or no-ip or some other service to connect.
    1. Test bypassing the TC.. plug the internet connection straight into the windows server,, and test if you have access. If yes, the TC is the problem.. if not, your setup on the windows server is wrong.. look at firewall in particular.
    2. Assuming from test 1 the TC is the problem, Post the screen shots of the port forwarding setup for us to look at.. that is by far the easiest way to check it out.
    There are lots of references to port forwarding in the TC.. eg
    http://must-know-mac.blogspot.com/2008/07/how-to-port-forward-time-capsule.html
    The things that generally go wrong are firewall on the computer that is accepting the port.
    The ISP doesn't allow connections on a particular port. (not likely in your case)
    The router is behind another router.. double NAT will kill any port forward.
    Upnp has already allocated a port.. not an issue as TC doesn't use upnp although a reboot of everything after you set port forwards is well worth it.. amazing how things don't stick properly without a reboot.
    IP on the receiving device is not static and so changes.
    Not enough or right type of ports are opened. This is always messier than it looks as one port is often not enough for two way communications.

  • Can someone please tell me a simple but effective method for burning a slideshow to DVD? Now that the connection between iPhoto and iDVD no longer exists, I can't figure out a way to get there with an acceptable quality result.

    Can someone please tell me a simple but effective method for burning a slideshow to DVD? Now that the connection between iPhoto and iDVD no longer exists, I can't figure out a way to get there with an acceptable quality result.

    Export the slideshow out of iPhoto as a QT movie file via the Export button in the lower toolbar.  Select Size = Medium or Large.
    Open iDVD, select a theme and drag the exported QT movie file into the open iDVD window being careful to avoid any drop zones.
    Follow this workflow to help assure the best qualty video DVD:
    Once you have the project as you want it save it as a disk image via the File ➙ Save as Disk Image  menu option. This will separate the encoding process from the burn process. 
    To check the encoding mount the disk image, launch DVD Player and play it.  If it plays OK with DVD Player the encoding is good.
    Then burn to disk with Disk Utility or Toast at the slowest speed available (2x-4x) to assure the best burn quality.  Always use top quality media:  Verbatim, Maxell or Taiyo Yuden DVD-R are the most recommended in these forums.
    If iDVD was not preinstalled on your Mac you'll have to obtain it by purchasing a copy of the iLife 09 disk from a 3rd party retailier like Amazon.com: ilife 09: Software or eBay.com.  Why, because iDVD (and iWeb) was discontinued by Apple over a year ago. 
    Why iLife 09 instead of 11?
    If you have to purchase an iLife disc in order to obtain the iDVD application remember that the iLife 11 disc only provides  themes from iDVD 5-7.  The Software Update no longer installs the earlier themes when starting from the iLIfe 11 disk nor do any of the iDVD 7 updaters available from the Apple Downloads website contain them. 
    Currently the only sure fire way to get all themes is to start with the iLife 09 disc:
    This shows the iDVD contents in the iLife 09 disc via Pacifist:
    You then can upgrade from iDVD 7.0.3 to iDVD 7.1.2 via the updaters at the Apple Downloads webpage.
    OT

  • Trying to choose a method for wireless access (non-Safari question)

    This isn't a Safari question, but I think plenty of Safari users would hopefully know an answer to it....and I'm not sure where else to ask:
    I'd like to be able to access Wi-Fi when I'm travelling-- which isn't very often, so I'm not keen on spending $1000+ on a laptop if all I'm using it for is to surf the net and check email.
    I'm thinking a PSP or similar gaming device would be a solution.....and entertain me as well. What other non-laptop products would give me Wi-Fi access?
    Thanks for any help!
      Mac OS X (10.3.9)  

    I'm thinking a PSP or similar gaming device would be
    a solution.....and entertain me as well. What other
    non-laptop products would give me Wi-Fi access?
    You want a PDA or perhaps a cellphone. I don't see any Apple connection. You'd probably be better off searching Google.

  • (nQSError:10018) Access for the requested connection is refused

    Hi Techies,
    Good Afternoon!!!
    Recently I faced a problem when I tried to view the data of my table in PHYSICAL LAYER
    (nQSError:10018) Access for the requested connection is refused
    (nQSError: 43037) Invalid Catalog, SupplierSales, specified.
    I did check my config file, every thing is proper. Even in NQSERVER log file it is showing that Finished Loading with out error.
    Same with the case of Answers. When I tried to login with administrator, it is throwing the same error as in RPD.
    I am unable to figure out the problem.

    Check you System DSN , ODBC > System DSN > AnalyticsWeb
    Make sure you have NOT enabled the "Change default repository to" or "Change default catalog to" as SupplierSales in either.
    Hope this helps.
    Thanks,
    -VS

Maybe you are looking for

  • Managing Family Clips on a Mac - Help - New Mac User

    I am new to the Mac and am looking for the most efficient way to manage my media. I have 300+ files that are in the later stages of being converted to Mp4. All of the files will reside in /Movies/imported. What should I do next? Should I import every

  • I just began to update my itunes and now it won't open

    Hi, My Itunes won't open when i click on in, at first it would do nothing but then when i tried to reinstall it and fix some errors with it, now it acts like its going to download something every time i click on it. What do i need to do so that i can

  • How to use true type font in smartform with ECC6

    hi,expert: I want to use true type font "Comic Sans MS.ttf". I upload this font file by SE73 named ZTT2I. In SE73.. select the Radio button "Font Families" And click on the "True type Font Installation" button. click the font attribute ITALIC. Our pr

  • Enterprise Portal For Sneak Preview 6.4

    Hi All, From where do i get the Enterprise Portal(/irj/portal) component compatible with Netweaver 6.4 Sneak Preview. Regards, Rupak Kumar...

  • Poor student in desperate need of help getting my Adam 4017 and 18 units functioning!!

    Thought I was getting a great deal. Like the loggers. Have them hooked up but I can not link to any program. Grant it I am a novice when it comes to these things. Im a microbiologist looking for bacteria that makes electric not a programmer. I need t