DataSource Problem--10 Points for this quick answer

import java.sql.*;
import javax.sql.*;
import javax.naming.*;
public class first
     public first()
          try
               Context ctx = new InitialContext();
               DataSource ds = (DataSource)ctx.lookup("jdbc/MyDataSource");
               Connection con = ds.getConnection("sa","manshu");
               Statement stat = con.createStatement();
               ResultSet rs = stat.executeQuery("Select * from final");
               while(rs.next())
                    System.out.println(rs.getString(1));
          catch(Exception e)
               System.out.println(e);
     public static void main(String args[])
          new first();
}I am connecting to sql server 2005 and i am getting an error : connection refused ..username and password both are correct..
is it possible to connect this way ??
plz answer... i am learning..

s = (DataSource)ctx.lookup("jdbc/MyDataSource");
               Connection con = ds.getConnection("sa","manshu");This is a JNDI lookup for the data source, a Java EE notion. What Java EE app server are you sending the JNDI request to?
I am connecting to sql server 2005 and i am getting
an error : connection refused ..username and password
both are correct..SQL Server 2005 knows nothing about Java EE. It does not have any notion of what a JNDI lookup is.
is it possible to connect this way ??No.
plz answer... i am learning..Use the DriverManager to connect.
You don't need a Windows DSN, but you do need a JDBC driver. You can get it either from Microsoft or jTDS, an open source JDBC driver. You download JAR files and add them to your CLASSPATH. Be sure you do that properly. Don't depend on a system environment variable. Use the -classpath option of java.exe when you run.
%

Similar Messages

  • 24 points for a single answer

    Hi SDN team,
    i can't stop complaining about getting more than 10 points for a single answer
    Please have a look at this Re: Inexisting BAPI_FLIGHT_GETLIST in our SAP system IDES. There are 4 * 6 points rewarded, which is nice, but not correct at all.
    Best, Stefan
    PS: Before i forget it, i do <b>not</b> want to have all the points removed (like it happened the last time i complained), 6 of the 24 are earned and ok.

    Hi Stefan,
    We have closed a hole in the point system last weekend. Let us know if it happens again.
    Thanks for letting us know, Mark.

  • J1IS (After GI in STO Process) will reward points for any helpful answers

    Dear Gurus,
    After Goods Issuance of Stock Transfer Order:
    I did a capturing and posting of Excise Invoice referencing the Goods
    Issuance Material Document (of STO) using transaction J1IS. Excise
    Document is created succesfully and displayed in the pop up message,
    but FI document is not displayed in the pop up message (but it actually
    got created in the system).
    The pop up message looks like this:
    "Excise invoice 001020026 generated. FI document is ."
    Is there a SAP note to enable the FI document number to be displayed in
    the pop up message?
    Will reward points for any helpful answers.
    Thanks,
    Jules

    Resolved with SAP's help:
    Run transaction FIBF.
    On the menu click on - Settings -> Products -> of a Partner -> Activate
    here maintain a new entry:
    Product Partner
    CIN INDIA

  • Epson software install problem: The software for this printer is currently unavailable. Please contact the printer's manufacturer for the latest software." But i have downloaded from Epson and Apple!!!

    I am trying to install a printer Epson xp-605 but when i try to add it, Apple says it can't find the software. I have downloaded the software from Apple website and also from the Epson installation disc!  The message is: "The software for this printer is currently unavailable. Please contact the printer’s manufacturer for the latest software."

    Try a reset of the printing system. This often resolves the symptom you are experiencing.

  • JMSAdapter problems... please this time answer me!!!

    Hi bpel people,
    I'm trying to let JMSAdapter work...
    first of all, I must point out that i'm new to JMS technology
    I've succesfully deploied a BPEL process which use an AQ adapter to listen to a queue of raw type, this process simply wait for new messages ready on the queue and then consume them.
    I've tryed to do the same thing with JMS technology but I was not able!!
    I've configured a new resource-provider in application.xml
    ..\OraBPELPM\integration\orabpel\system\appserver\oc4j\j2ee\home\config\application.xml
    and this is the added content:
    <resource-provider class="oracle.jms.OjmsContext" name="myjms">
    <description>OJMS/AQ</description>
    <property name="url" value="jdbc:oracle:thin:@10.14.2.36:1521:CLUDB1" />
    <property name="username" value="JMSUSER" />
    <property name="password" value="JMSPWD" />
    </resource-provider>
    then i've inserted in ..\OraBPELPM\integration\orabpel\system\appserver\oc4j\j2ee\home\application-deployments\default\JmsAdapter\oc4j-ra.xml
    this section:
    <connector-factory location="eis/aqjms/MyQueue" connector-name="Jms Adapter">
    <config-property name="connectionFactoryLocation" value="java:comp/resource/myjms/QueueConnectionFactories/rawQCF"/>
    <config-property name="factoryProperties" value=""/>
    <config-property name="acknowledgeMode" value="AUTO_ACKNOWLEDGE"/>
    <config-property name="isTopic" value="false"/>
    <config-property name="isTransacted" value="true"/>
    <config-property name="username" value="jmsuser"/>
    <config-property name="password" value="jmspwd"/>
    </connector-factory>
    and my JMS service jca info are:
    <binding name="Consume_Message_binding" type="tns:Consume_Message_ptt">
    <pc:inbound_binding />
    <operation name="Consume_Message">
    <jca:operation
    ActivationSpec="oracle.tip.adapter.jms.inbound.JmsConsumeActivationSpec"
    DestinationName="java:comp/resource/myjms/Queues/RAW_QUEUE"
    UseMessageListener="true"
    PayloadType="TextMessage"
    OpaqueSchema="true" >
    </jca:operation>
    <input>
    <jca:header message="hdr:InboundHeader_msg" part="inboundHeader"/>
    </input>
    </operation>
    </binding>
    <service name="jmsmu">
    <port name="Consume_Message_pt" binding="tns:Consume_Message_binding">
    <jca:address location="eis/aqjms/MyQueue" />
    </port>
    </service>
    any help will be veeeery appreciated
    Lisa

    Generally this is a sign that the iPhone had previously been
    hacked/modified/jailbroken and the update relocked it to the
    original wireless carrier. If this is the case, only that wireless
    carrier can unlock your iPhone. You must contact them to see
    if they offer unlocking and if you qualify.
    Where did you acquire this iPhone?
    What wireless carrier did you use before this problem?
    Does the app Cydia appear on your iPhone?
    What does it say when you look at Settings=>General=>About=>Carrier?
    Unauthorized modification of iOS
    http://support.apple.com/kb/HT3743

  • Harm, looking for a quick answer on a RAID question...

    I bought a G-Speed ES drive with the G-Tech RAID card, set up the drive yesterday, initialized it (took 9 hours!) as a RAID-5, and in the initiallization settings window I was asked what sector size I wanted. I did some quick research and found that bigger sectors are better with bigger files, so choose the maximum size available to me under the hardware RAID, which was 4k (I'm assuming that's 4096). Came into the office this morning and found the drive had finished the initilization and that Windows required me to create a "simple volume" on it before it could be used. I'm in the process of doing that, and have found that Windows is asking me to set a sector size again: This time my maximum option is 64k. Do I want to go with the maximum option of 64k, or do I have to use the 4096 which the hardware RAID used in initializing the array?

    David,
    This may be informative: http://www.tomshardware.com/reviews/wd-4k-sector,2554-3.html
    With a sector size or cluster size of 4 KB, data are distributed across the partition in 4 KB parts. Suppose you have a 10 KB file, three full clusters will be occupied: 4 KB - 4 KB - 2 KB. The remaining 2 KB is called slackspace and can not be used by other files. With a block size (stripe) of 64 KB, data are distributed across the array disks in 64 KB parts. Suppose you have a 200 KB file, the first part of 64 KB is located on disk A, the second 64 KB is located on disk B, the third 64 KB is located on disk C and the remaining 8 KB on disk D. Here there is no slackspace, because the block size is subdivided into clusters. When working with audio/video material a large block size is faster than smaller block size. Working with smaller files a smaller block size is preferred.
    Sometimes you have an option to set 'Chunk size', depending on the controller. It is the minimal size of a data request from the controller to a disk in the array and only useful when striping is used. Suppose you have a block size of 16 KB and you want to read a 1 MB file. The controller needs to read 64 times a block of 16 KB. With a chunk size of 32 KB the first two blocks will be read from the first disk, the next two blocks from the next disk, and so on. If the chunk size is 128 KB. the first 8 blocks will be read from the first disk, the next 8 block from the second disk, etcetera. Smaller chunks are advisable with smaller filer, larger chunks are better for larger (audio/video) files.
    What you see as 'sector size' from Windows is better called the block size and for video you can best choose the maximum, in this case 64 KB.
    BTW, also have a look at Adobe Forums: How to access more than 2 TB of disk...

  • Xml Forms Render trouble, reward points for this.

    My Xml News are arranged and shows asynchronosly, i need arrange them by date.

    Hi Dominic,
    yes, that is possible. You can use several extensions. E.g read the room-name, then use the extension 'on createRoom', give it the name of the room (which is the result of the previous extension) etc. If you want, you can give me your e-mail-address and I can send you an example of a mapping-plan doing a similar thing
    Kind reagrds
    Karin

  • I need help--get easy points for this one!

    my video will not finish downloading...it has stopped. please answer a reply... i really need help! i purchased a t.v. episode from the iTunes store and it has stopped downloading...but it has downloading partially, just not completely. please help!

    on itunes. it is downloading on itunes...or at least it was. but its stopped.

  • Making it easier to award points for individual answers on the same slide.

    Hi
    One of my biggest requests would be for it to be made a lot easier to award points for individual answers.
    For example: I would like to use the 'fill in the blanks' quiz to create something that is reffered to in educational circles as 'cloze procedure'. Basically I would like to create an entire slide of text with many blank areas that need to be filled in. This is possible at the moment but it is only possible to award points based on every single answer being correct. I would like to award individual points for each correct answer on the slide.
    At the moment this can be done with a lot of complex scripting but I would like to be able to do it at the push of a button.
    Cheers

    Here is the link:
    https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform&product=5
    You can also find it in the main screen of the Captivate forums. That is the way to log a feature request. In the new forum, you can also post Ideas, but the feature requests do reach the team certainly:
    http://captivate.adobe.com/captivate/ideas/popular
    Lilybiri

  • Points for unknown bugs

    Hi,
    why you reach point for a good answer, article, tutorial etc. but not when you report an unknown bug?
    SAP should always be happy for improving his software.
    Kind regards
    Roberto

    Roberto, I have a suspicion that SAP might actually not be very happy about you reporting a bug, especialy if it's something that has little effect (e.g. works only in particular scenario). From their perspective (again, just my guess) it worked just fine, everyone was happy and now you come in and they have to make a change. On top of that, they need to make sure they don't break something else (how many times you see the note correcting the note correcting another note... <to infinity>). So at this point they probably hate you.
    To me personally squeezing out a correction note from SAP is already a reward since most of the time the reply is that everything is correct "by design". (I'm a very reasonable and logical person and still do not understand why some things work "by design" in such a way that it makes no sense and is causing problems for the users and need for modifications.)

  • Problem rewarding points

    Hi guys,
    I would like to give points for this topic:
    Database copy on same server
    but it's not possible, I had the same problem for an older topic too...
    The error is:
    Community Forums Error
    Error:
    Rewarding the message failed.

    Hi,
    I had RSS problems with the forums for a while. Maybe there was a temp outage. Can you give it a try. If it doesn't work, you'd better send an e-mail to [email protected]
    Eddy
    PS.
    Put yourself on the SDN world map (http://sdn.idizaai.be/sdn_world/sdn_world.html) and earn 25 points.
    Spread the wor(l)d!

  • I need a correction for this ...!!!!

    i came up with a recusive method but it has some inefficiency .. if i create an object of type int ,say 1234567 it will work properly, but if the int was say 1000000 or 1000001 it will return 1,0 and 1,1 ,respectively ... and here is the code .. i need a correction
    ===========================================================
    public class intComma
    public static String putComma(int x)
    String st = x+"" ;
    int L = st.length() ;
    if (L<= 3)
    return st;
    else
    if (L%3 == 1)
    return st.charAt(0)+","+putComma(Integer.parseInt(st.substring(1)));
    else if (L%3 == 2)
    return st.substring(0,2)+","+ putComma(Integer.parseInt(st.substring(2)));
    else
    return st.substring(0,3)+","+ putComma(Integer.parseInt(st.substring(3)));
    public static void main(String[] args)
    System.out.println(putComma(1234567));
    System.out.println(putComma(1000000)); // here is the problem
    System.out.println(putComma(1000001)); // here is the problem
    }

    you mean for this:
    http://forum.java.sun.com/thread.jspa?threadID=784872

  • Double rewards for a single answer :p

    Hi SDN,
    having a look at my list of rewarded points the following thread: DYNPRO_SEND_IN_BACKGROUND is listed with 6 <b>and</b> 10 points for my only answer to the thread.
    Although i shouldn't actually complain about this it shouldn't be possible normally, right? So it would be nice, if somebody could take a look, what went wrong there.
    Best regards,
    Stefan

    20 points for the same answer. I shall repeat Stefan Klensch statement "Should not really complain !!! ", but this is the link
    Destroy ALV grid object
    Kindly look into this("Spreading too much love, or is it the evil spell, Mark mentioned("Seven years of bad ***"))
    ( /people/mark.finnern/blog/2004/08/10/spread-the-love ).
    Regards,
    Subramanian V.

  • HANA Mount Point for MCOS

    Hi All,
    We have implemented BW on HANA System and it was all implemented as single instance on one Hardware, now we have to implement HANA in MCOS for DEV and QAS system.
    The current file system is :
    Filesystem              Size  Used  Avail   Use% Mounted on
    /dev/sda1                63G   11G   50G    18%  /
    devtmpfs                127G  280K  127G   1%  /dev
    tmpfs                     213G  100K  213G   1%  /dev/shm
    /dev/sapmntdata      1.1T   16G  1.1T     2%  /sapmnt
    Need to know the new mount point for this for MCOS type implementation. Where our DEV and QAS will reside in the same HANA DB box.
    Thanks,
    Sharib
    Message was edited by: Sharib Tasneem

    Hi All,
    There is no separate Mount point needed for MCOS HANA system.
    Need to provide log directory, data directory and Shared folder during MCOD creation.
    Log Directory will be /<Shared directory>/log/SID2 which in our case was /sapmnt/log/SID2
    Data Directory will be /Shared Directory>/data/SID2 which in our case was /sapmnt/data/SID2
    And Shared location which is /sapmnt/ in our case.
    Use HLM(HANA Life cycle management tool to create new HANA SID. It was like a Cake walk for Updateing HANA Revision, Client, etc.
    Thanks and Regards,
    Sharib
    Note: You need to create SID2 directory inside the location and give appropriate permission to <SID1>ADM user to write over there.
    Message was edited by: Sharib Tasneem

  • Rewards point for ebay purchase

    Hi I just bought a couple of PSN cards on ebay, from the official bestbuy account. Can I get rewards points for this purchase?

    Hello again d3sm0nd,
    I hope that you are enjoying your Wednesday morning.
    That is a great question!  As far as I know, a purchase made from the Best Buy eBay Store is not eligible for points because Best Buy on eBay is not associated with the My Best Buy™ program.  It would almost be like the products that are sold through our online Marketplace, which are also not eligible for points.  I have provided a link to the Best Buy eBay Store FAQ below if you have any additional questions.
    Best Buy eBay Store - FAQ
    Thank your for posting to the forum and for being a My Best Buy™ member!
    Derek|Social Media Specialist | Best Buy® Corporate
     Private Message

Maybe you are looking for

  • How does labview detect end of file?

    Hello! My question is how labview detects the end of file at the Read from Spreadsheet File VI.  What I would like to do is basically to read from a  text file a number of numeric values and afterwards build an array containing these values. Till now

  • Correct MYSQL settings for the local akonadi server

    Hello! I am on KDE 4.11 and it runs quite good after some polish. But I am still hitting some problems with akonadi ... My configuration is set to use my running mysql server on localhost. So the akonadiserver is set to NOT use akonadi internal mysql

  • CAPTURE_UPTIME ERROR

    I am seeing the following error in /var/adm/messages after a fresh install of Solaris 10. I selected full install [ID 702911 daemon.error] CAPTURE_UPTIME ERROR: /var/opt/SUNWsrsrp missing Any clues? Thanks in advance

  • My iphone activation is failed i did changed my sim and now its giving me this problum

    Hi Pls help me to activate my 4s.I did chenge my sim in pakistan and now i am stuck,my phone does show activation require but its not activating,pls any one can help me out with this problum,thanx

  • Macbook with retina display + 500GB western digital hard drive

    I have just bought my macbook pro with retina display and I have a Western Digital hard drive that doesnt show up when I plug it in. How can I make this work?