Is there one tell  me the correct way to access remote SQL server

Hi
I have tried to access a remote SQL server by many ways but all failed
here is my trying :
String driver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
String url= "jdbc:microsoft:sqlserver://217.52.98.102:1433";
Class.forName(driver);
Connection conn = DriverManager.getConnection(url,"sa"," " );
String selectStr = "select * from FleetWatch..table_name";
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery(selectStr);
DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());
// connect to the DB by using the driver.
String connString = "217.52.98.102:1433;databasename=FleetWatch";
String strDBConnect = "jdbc:microsoft:sqlserver://" + connString;
conn = DriverManager.getConnection(strDBConnect, "sa", "");
String driver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
Class driverClass = Class.forName(driver, true, jdbcLoader);
Driver currDriver = (Driver)driverClass.newInstance();
Properties prop = new Properties();
prop.setProperty("sa", (String)paras.get("sa");
prop.setProperty("password", (String)paras.get(" ");
String url= "jdbc:microsoft:sqlserver://217.52.98.102:1433";
conn = currDriver.connect((String)paras.get(url, prop);
pls tell if you know the correct way to access a remote sql server and
access it befor tell me its step to ensure it's connect

String driver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
String url= "jdbc:microsoft:sqlserver://your servername:1433";
Class.forName(driver);
Connection conn = DriverManager.getConnection(url,"username ","password " );
this user name and password may be diff becoz if u have only sql authentication then u have to know that user name or it can have windows nt authentication so if it is so then no probs can use ur windows nt login..
know the server name where ur sqlserver is connected to.
set the classpath for the sqlserverdrivers jar files which u have downloaded where ur working on.
then it works
i did the same and worked for me.
try it.

Similar Messages

  • Query to find the user is having access to sql server DB

    Hi,
    Please help me in this.
    Query to find the whether the user is having access to sql server DB.
    Cheers,
    sajith

    TUBBY_ORCL?Select 1 from dual where 'ORACLE' = 'SQL SERVER';
    no rows selected
    Elapsed: 00:00:00.01

  • Can someone tell me the correct way to write a link in Portal?

    I know this may be asking a lot from the Portal user community, but I'm at my wits end here.. does anyone know how to CORRECTLY write a self-refrencing porlet that passes some simple parameters?
    A link to documentation would be preferred, but just a simple answer would unblock my process. :-]
    (I have scoured the docs.. no luck :-( )

    Okay,... .this is rediculous. I have spent the past few hours.. I say HOURS.... digging to find the Portal / Java equivalent of a way to reference the same page via standard link.
    An example in ASP of what I want to do would be:
    <a href="<%=Request("SCRIPT_NAME")%>?folder=<%=strFolder%>">
    Pretty basic, eh?...
    The fact that I can't figure this out really leaves my quite unimpressed with Oracle's Portal product. I've spent wayyyyy too much time digging through this "Portal Center" portal.
    Is there anyone who can help? Anyone??? Hello ORACLE!.....
    I just found this seemingly neat UrlUtil class... and of course, I can't figure out how to use the thing because we have no programming guides!!!!!! And the JavaDoc is only useful as reference... it isn't telling me how to use!!
    AAAAHHHH!!! Someone help!
    -s-

  • Some questions about the correct way to recharge the zen micro batt

    Ok..i don't think this is convered in the FAQs.
    I copied this from the FAQ----At the present moment, the only possible way to avoid the standby loss is removing the battery after you finish listening to music. Gi'ven the wear and tear resulting, this is not really an option. It will help, though, if you prime your battery correctly, recharge it often (topping it up, not only resorting to full recharges),
    Ok...my question--
    ) to preserve battery life span, shouldn't we wait for the player to die off complete, for example when it starts to display "low battery" before we recharge it's Does this post mean that we shouldn't actually wait for the battery to be complete;y drained off before a recharge? Does it mean we should always recharge, say when there's one bar left?
    2) Before doing any music transfer using the computer, should we always make sure the zen micro was fully charged first before the transfer since USB port also serves as a charger. I tried using a completely drained player before music transfer and the player stops charging after 3 hours, which shouldn't be the case because USB always take a longer time to charge (i was told twice as much) and true enough, after deplugging from the USB port, the player starts charging again. Note that this always happen, meaning i can never get a complete 5 hours charge using the USB. What is wrong? And after such charge from USB, i noticed that the battery life the next day is like one third of what it usually last when i charged it through a charger...
    I know this is a long post but can someone tell me the correct way of charging?
    Thanxs!

    immunophilic wrote:
    Ok..i don't think this is convered in the FAQs.
    I copied this from the FAQ----At the present moment, the only possible way to avoid the standby loss is removing the battery after you finish listening to music. Gi'ven the wear and tear resulting, this is not really an option. It will help, though, if you prime your battery correctly, recharge it often (topping it up, not only resorting to full recharges),
    This is from JazzMC's FAQ right? (I added a link to this a day or two ago from the main FAQ post) I hadn't spotted this before and I don't agree with most of this. The wear and tear is minimal, but it's more a case of practicality that removing the battery is a pain. Also priming is not really that important with Lithium Ion, and topping up won't make any difference to the battery drain.
    ) to preserve battery life span, shouldn't we wait for the player to die off complete, for example when it starts to display "low battery" before we recharge it's Does this post mean that we shouldn't actually wait for the battery to be complete;y drained off before a recharge? Does it mean we should always recharge, say when there's one bar left?
    Look in my Nomad Primer, which is essentially a distilled version of the information from BatteryUni'versity.com. Top-up charges prolong the life of a Lithium Ion battery. These are all reference in the FAQ.
    2) Before doing any music transfer using the computer, should we always make sure the zen micro was fully charged first before the transfer since USB port also serves as a charger. I tried using a completely drained player before music transfer and the player stops charging after 3 hours, which shouldn't be the case because USB always take a longer time to charge (i was told twice as much) and true enough, after deplugging from the USB port, the player starts charging again. Note that this always happen, meaning i can never get a complete 5 hours charge using the USB. What is wrong? And after such charge from USB, i noticed that the battery life the next day is like one third of what it usually last when i charged it through a charger...
    Because of the Micro's design there will always be a difference in the amount of power it can pull via USB vs. the drain when copying files to it. USB is slower to charge than the mains adapter, but it should charge fully given time (which could be twice as much as using the mains adapter).
    There is a known issue with the battery draining on the Micro, but you should know this having read JazzMC's page. This is the reason the battery is so low the next day.

  • Is there any way of importing stuffs from Microsoft Access to SQL Server?

    I have quite a big store of information Microsoft Access DB, but now i am required to switch to SQL Server?
    Is there any way of importing to SQL Server, either by Java programming or manually?
    Thank you in advance.

    I like to give some tips on how to fulfil the requirement.. I haven't tried this. If you succeeded, it is well and good.
    1) Using Java:
    If you like to Java to import the data from MS Access to SQL Server, you have to write a JDBC Program in such a way that it has to retrieve the data from each MSAccess tables and store it in temperory java varaible.After writng into the temp. varaibles, the same thing will be written into SQL Server. The whole process is repeated for all the tables in MS Access.
    2) Manual Process:
    Try to get the data scripts from MS-Access for all the tables and Load the same into SQL Server
    I hope that Manual Process consumes less time compared in writing the codes for transformation..
    I hope that you got some idea on reading this. If you have any doubts, try to get back to me..

  • Can any one tell whether the concept which i understood is correct or not

    hai everyone
    iam studying jdbc and this is what i understood about the basic concept .can any one tell whether the concept which i understood is correct or not
    whenever the statement class.forName("driver class") is executed driver class is loaded and registered with drivermanager.Internally drivr class contains a static bloc which contains the following code
    static
    Driver drv=new name of driver class();
    DriverManager.registerDriver(drv);
    whenever the statement class.forName("driver class") is executed,static bloc is executed first and driver class is registerd.
    concept as i understood about DriverManager:
    suppose there may be situations where an application developed in java has to deal with one or several databases and this is accomplished with one or different driver classes.so all these driver classes are to be managed and this is done by DriverManager class and in order to make the driver class itself known to the driver manager we have to register the driver classes with the help of registerDriver() method of DriverManager class because DriverManager is the class which will attempt to load the driver classes into memory..
    If we look at the last statement: DriverManager is the class which will attempt to load the driver classes into memory.Here i have some doubt if DriverManager class loads the driver class after registering the driver class then what does the statement class.forName("driver class") will do which is also used to loaad the driver class.
    what i understood is since the responsibility of loading the class is done by class.forName("driver class") only registering of the driver class is done as the class is alredy loaded.
    help me to clear my confusion
    thanks in advance

    hai everyone
    iam studying jdbc and this is what i understood about
    the basic concept .can any one tell whether the
    concept which i understood is correct or not
    whenever the statement class.forName("driver class")
    is executed driver class is loaded and registered
    with drivermanager.Internally drivr class contains a
    static bloc which contains the following code
    static
    Driver drv=new name of driver class();
    DriverManager.registerDriver(drv);
    }That's supposed to be the case, but there's no way to guarantee that every driver actually has that static init. I don't think I've ever run across one that doesn't, though, so, yes, you're basically correct.
    whenever the statement class.forName("driver class")
    is executed,static bloc is executed first and driver
    class is registerd.When you do Class.forName(), the class is loaded and initialized. Whenever you initialize a class, its static init blocks are executed, yes.
    concept as i understood about
    DriverManager:
    suppose there may be situations where an application
    developed in java has to deal with one or several
    databases and this is accomplished with one or
    different driver classes.so all these driver classes
    are to be managed and this is done by DriverManager
    class and in order to make the driver class itself
    known to the driver manager we have to register the
    driver classes with the help of registerDriver()
    method of DriverManager class because
    DriverManager is the class which will attempt
    to load the driver classes into memory..Except for that last part, yes.
    DM keeps track of loaded drivers, and gives them a chance to parse the connection URL when you call getConnection. DM does NOT load the driver classes into memory, however. That's done when you call Class.forName.
    what i understood is since the responsibility of
    loading the class is done by class.forName("driver
    class") only registering of the driver class is done
    as the class is alredy loaded.Right.

  • I would like to read a text file in which the decimal numbers are using dots instead of commas. Is there a way of converting this in labVIEW, or how can I get the program to enterpret the figures in the correct way?

    The program doest enterpret my figures from the text file in the correct way since the numbers contain dots instead of commas. Is there a way to fix this in labVIEW, or do I have to change the files before reading them in the program? Thanks beforehend!

    You must go in the labview option menu, you can select 'use the local
    separator' in the front side submenu (LV6i).
    If you use the "From Exponential/Fract/Eng" vi, you are able to select this
    opton (with a boolean) without changing the labview parameters.
    (sorry for my english)
    Lange Jerome
    FRANCE
    "Nina" a ecrit dans le message news:
    [email protected]..
    > I would like to read a text file in which the decimal numbers are
    > using dots instead of commas. Is there a way of converting this in
    > labVIEW, or how can I get the program to enterpret the figures in the
    > correct way?
    >
    > The program doest enterpret my figures from the text file in the
    > correct way since the numbers contain dots instea
    d of commas. Is there
    > a way to fix this in labVIEW, or do I have to change the files before
    > reading them in the program? Thanks beforehend!

  • What is the correct way to create links to my website?

    Hi
    My site is finally finished and I am now looking to list it on various directories on the internet to generate links to my site.
    When my site opens in a browser it shows up as http://ateccomputerservices.co.uk
    I know this question has been asked many times on the internet but what is the correct way to post my link?
    I know I should be consistent and use www or not on every link but none of the articles tell me whether I should use http:// or not when linking.
    So for example, should I use...........
    http://ateccomputerservices.co.uk
    or
    http://www.ateccomputerservices.co.uk
    or
    ateccomputerservices.co.uk
    or
    www.ateccomputerservices.co.uk
    and should I put /index at the end?
    Once I've decided on which link to use should I redirect all the other addresses to the main one?
    I'm pretty new to web design so I need some advice from some seasoned experts
    Thanks for taking the time to read my questions!

    When you browse to http://ateccomputerservices.co.uk and to http://www.ateccomputerservices.co.uk do you get the same page?  Most hosts will automatically create a CNAME record for both 'www.example.tld' and 'example.tld' when the hosting account is created, but not all do.  If that second CNAME record is not created, then you must always use the "www" prefix.
    If the reference to your site is a text reference only, then you could just use 'www.ateccomputerservices.co.uk', but if it's a link you should always make the LINK part (the HTML href attribute's value part) as a fully qualified URL, i.e., 'http://www,ateccomputerservices.co.uk' or 'http://ateccomputerservices.co.uk':
    <p>Click <a href="http://ateccomputerservices.co.uk">here</a> to link to my site .</p>
    When a browser requests that domain from the server, the server will fetch the first file it finds with a 'default filename' (usually 'index.html' or 'index.php' or 'home.html' or...) and upload that to the browser, so there is no need to further specify the filename - the default is when no filename is given.
    Once I've decided on which link to use should I redirect all the other addresses to the main one?
    I'm not sure what you are asking here....
    I'm pretty new to web design so I need some advice from some seasoned experts
    In the immortal words of comedian Myron Cohen, "everybody gotta be somewhere".

  • Can some one tell me a better way...

    Hi All..
    I work on a web application. I create user ids for people logging into my application. here I have a small problem.. This is what I am currently doing...
    When I create a new user, I assign a new user id to the user and store all hi info.
    All our user ids are stored in User_ID table and user info in User_Info table.
    First I get the max user id from the User_Id table.
    int iuserid = select max(User_ID) from User_ID;
    Then I add ' 1 ' to this and assign it to new user.
    iuserid = iuserid+1;
    insert into User_id values(iuserid, <ssn> );
    Then I store all user info in User_info table..
    insert into User_info(iuserid, <first_name>, <last_name>,...);
    Both these SQLs are executed as a transaction.
    The problem that I have...
    It works fine in a normal environment and in my testing.
    But when the load inceases, before I insert into the User_info, another user tries to get the max User_id from User_ID table, then it conflicts..
    I have seen occurences of User_Info storing the info of a different user against the User_id when many people are accessing the app at the same time.
    Can some one tell me a better way to handle this scenario..
    Appreciate all you help..
    TIA..
    CK

    Hi,
    assuming that the requirement for user_id is only for uniqueness (primary key requirement) not continuosly.
    perhaps can try this,
    1) create a table to keep the max id for each table's key.
    e.g.
    create table key_id_lookup
    key_name char(n),
    current_value number(m)
    where n & m is the size of the field
    2) for each creation of entry in the user_id table, lookup the value in the key_id_table and increment it after retrieval.
    e.g. current_id = select current_value from key_id_lookup where key_name = 'user_id_key';
    current_id+=1;
    update key_id_lookup set current_value = current_id where key_name = 'user_id_key';
    something similar to use of sequence if your database support it.
    3) continue with the creation of record in other tables. now obtain the time stamp of creation and append with the current_id obtained. e.g. timestamp = 132456872; size of m is 5, user_id = 132456872 x 100000 + current_id;
    this should give you a unique key at creation time.
    There should be other better ways of resolving this(like locking the table for the update operation but affect performance, etc), depending on the feature supported by the database in use.
    Hope this can help as last resort if other options not available.

  • What is the correct way to set up a new Mac

    A friend of mine recently migrated from Windows and bought himself an iMac. He got the local Apple store to set up his iMac and migrate his data from his Windows to his iMac. I was  recently helping him set up a few a additional things on his iMac and was supprised to see how the Apple store had set up the machine.
    There was only one account set up on the iMac and all of the user data had been loaded into this admin account. Now I've only been a Mac user for about 5 years, but I was always taught create an admin account with no data on it and then set up a separate user account(s) which contain all the user data and these are used by the users to log in.
    Now my question is who is right the Apple shop or me? I would e intertested to hear any experts views on the correct way to set up an OSX machine. 

    Both of you. Either way is acceptable. However, for a single user machine there's really no need to have more than the admin account.

  • What's the correct way to handle changes in RDBMS/DBadapter?

    In my project all changes to the database are not done via Jdeveloper but via TOAD. This means DBadapters must be made aware of changes in the database.
    I tried to re-run the DBad.apter wizard twice (2 different services) - to make it aware of changes in the DB. Both times it failed. I think was after the import database tab. The next tab was just blank.
    So what's the correct way of reconile changes in the db backwards into Jdev?
    BTW, in the DBadapter wiz its not possible the remove a already imported table. How do I come across the situation where I want the DBadapter to point to af different table? - and possibly remove old references to another one - which might have been removed in the DB.
    As It is now - I have to re-work all my DBadapters, which is not very much fun...
    Rgds, Henrik

    Trust me, I hv done that umpteen nbr of times.
    I hate BA's coming to me with changes, for which I hv to modify the DB adapter.
    One big loop-hole with BPEL is if we try to modify the adapters/toplink, it doesnt tend to work properly.
    The manthra for such modifications is ... "recreate", which is definetely not a good practise.
    You may not like but gottu live with it, my friend.
    Pointing to a different table, I achieve it by doing a "Shift+Delete" to all the references of the old table in the BPEL project ... :|
    There isnt a specific provision in the wzd (I am not sure of the latest version, though).

  • How does one tell if the J2EE services are running with Unlimited

    How does one tell if the J2EE services are running with Unlimited
    security? We have applied the export Policy to the server but we do notsee any reference to it running with it. .we apply the Service packs SAP now upgrades that JAVA as well . Do that process treat the JAVA
    lib/security area correctly.

    Just out of curiosity... Is there something you do
    like about Mac/Apple?
    To answer your question: no, not really. However, the points that I made here were about Safari and accompanying utilities, not about Apple in general.
    If it makes you feel any better, I am just as, or even more, critical of Micro$oft as the occasions arise...Windoze Vista is the most recent occasion and has given sufficient reasons and opportunities to vent my spleen that I actually have eased up on Apple, politicians, nut-case religious extremists, cell phone owners, and the Department of Homeland Paranioa, etc., due to an exhaustion of creative energy.

  • Which is the correct way to filter/block traffic between vlans?

      Hi all. My question is: Which is the correct way to filter/block traffic between vlans?
    i have a more than 15 vlans. I want to block traffic between them except 2 vlans.
    source vlan 3 deny destination vlan 4
    #access-list 100 deny ip 192.168.3.0 0.0.0.255 192.168.4.0 0.0.0.255
    and the oposite:
    #access-list 101 deny ip 192.168.4.0 0.0.0.255 192.168.3.0 0.0.0.255
    I have to do this for all VLANs, ono by one. Is that right?
    Thanks.

    There are a couple of ways to achieve that. I assume that you have a Layer3-Switch. There I would configure one ACL per vlan-interface and allow/deny the traffic as you want. Sadly, the Switches don't support object-groups yet, so you have to use the IP-networks here. Only allow/deny traffic based on networks or hosts. Don't even try to be very granular with permit/denys based on ports. Because the switch-ACLs are not statefull you'll run into problems for the return-traffic if you woulf do that. And the return-traffic of course has to be allowed also.
    Another way: with the help of 802.1x you can deploy port-based ACLs for every user. That takes some time for planning, but is one of the most powerful solutions.
    For more control you could remove the L3-interface from your L3-switch and move that to your router or firewall. These devices support stateful filtering and you can control your traffic much tighter tehn with ACLs on the switch.
    Don't stop after you've improved your network! Improve the world by lending money to the working poor:
    http://www.kiva.org/invitedby/karsteni

  • What is the correct way to destory a Thread?

    Just wondering what is the correct way to destroy a thread? I am currently using the stop() method, but i noticed that it has been depreciated (along with other methods used to destroy a thread) when i looked at the thread documentation. Since this is so, then how can one correctly destroy a thread? Thanks in advance for the help.

    There is an awful lot of bad advice in this thread about what null does. Please in future check on your own with working code before offering up misguided and very wrong advice. Particularly when your advice contradicts that previously given.
    Please compile and run the following
    public class Test implements Runnable{
      public static void main(String args[])throws Exception{
        Test test = new Test();
        Thread t= new Thread(test);
        t.start();
        // have delay wait a few seconds to demonstrate
        Thread.sleep(3000);
        System.out.println("Setting reference to thread to null");
        t = null; // what does this do?
        // jack all
        System.out.println("Exiting main");
      public void run(){
        while(true){
          System.out.println("Hello from test thread!");
          try{ Thread.sleep(750); }catch(InterruptedException iDontCareAboutThis){}
    }This will output the following
    C:\>java Test
    Hello from test thread!
    Hello from test thread!
    Hello from test thread!
    Hello from test thread!
    Setting reference to thread to null
    Exiting main
    Hello from test thread!
    Hello from test thread!
    Hello from test thread!
    Hello from test thread!
    Hello from test thread!
    Hello from test thread!And continues on endlessly. Setting the reference to null is NOT an answer to this problem.

  • The correct way...

    Hello guys,
    I have the next situation, 9 LAPs 1142N, i wish to convert them to autonomous, it seems that there is a 2 ways, with a simple copy tftp flash: commands and force them to charge the IOS.default  image(holding the mode button), what is the correct way??
    I used the first one (copy tftp flash and etc commands) decompressing the winrar file downloaded (c1140-k9w7-tar.124-25d.JA1) and just selecting the .JA file inside, then using the boot system command, but when a try to use the browser appears with out menus! buttons and etc options!, I supose that I need to charge ALL winrar file, but how? some suggestion??
    Sorry 4 my English hehehe...

    HERE, I SHOW THAT I CAN COPY FILES FROM MY LAP-TOP TO THE AP:
    4 bytes copied in 0.042 secs (95 bytes/sec)
    HERE, I EXECUTE THE RECOMMENDED COMMAND:
    AP44d3.ca19.81a6#$ftp://15.10.10.184/c1140-k9w7-mx.124-25d.JA1.rar flash:
    Loading c1140-k9w7-mx.124-25d.JA1.rar from 15.10.10.184 (via GigabitEthernet0):
    %Tar checksum error in fd 0 --------------------------------------- "THIS IS THE ERROR"
    AP44d3.ca19.81a6#sh flash:
    Directory of flash:/
        2  -rwx        3566   Mar 1 2002 00:29:43 +00:00  private-config
        3  -rwx           4   Mar 1 2002 00:29:00 +00:00  test.txt
        4  -rwx         150   Mar 1 2002 00:14:33 +00:00  event.log
        5  -rwx     4791401   Mar 1 2002 00:52:40 +00:00  c1140-k9w7-mx.124-25d.JA1
        6  -rwx        1048   Mar 1 2002 00:29:44 +00:00  private-multiple-fs
        7  drwx         128   Mar 1 2002 00:02:01 +00:00  c1140-rcvk9w8-mx
       10  -rwx       17468   Mar 1 2002 00:29:43 +00:00  config.txt
       11  -rwx         217   Mar 1 2002 00:53:22 +00:00  env_vars
    HERE, I SHOW THAT THERE IS ENOUGH SPACE(THE COMPRESED IMAGE SIZE 5MB):
    32126976 bytes total (25048064 bytes free)
    AP44d3.ca19.81a6#

Maybe you are looking for

  • Help........Show image from database

    Hi, I am stuck at one point. I have to show image stored in the database on the browser. I am able to fetch the image and show it after storing it in one .gif file. But what I want it is : I don't want to store the fetched image in to a .gif file ins

  • Getting error in expdp....

    Dear All, My database is 11gR2 on Linux. During mid of expdp process I am getting this error: ORA-31693: Table data object "ETISLBILLING"."SDR_TBLICPCDRSUMMARY" failed to load/unload and is being skipped due to error: ORA-29913: error in executing OD

  • Advance input tax

    Dear All,   In the Advance tax report for input tax, (S_ALR_87012357), in case of LST, the base amount,  input tax amount and  gross amount is not coming properly. The VAT amount is coming in the base amt column, Surcharge in tax amount and total of

  • Reaktor 5 & Logic 7.2 Pro TDM

    Hello I can only get Reaktor 5 to work on 1 Instrument Channel. Reaktor 5 will load on another Instrument channel, midi gets to Reaktor 5, but no sound comes out. Other Native Instrument plugins work fine Any suggestions Thanks Adam G5 4 X 2.5GHZ   M

  • Screen Area

    I am trying to produce a movie on 5.5 around the start button on Windows 7. I have tried this on a laptop and pc screen and although I have used every possible option in the Screen Area from Full screen to customising options (both large and small),