The syntax for accessing MS SQL db from JSP

Can anybody help me with the syntax for accessing MS SQL db from JSP???
This is what I do when I use MySQL:
Class.forName( "org.gjt.mm.mysql.Driver" );
Connection conn = DriverManager.getConnection(
     "jdbc:mysql:://um" ,
What do I write when it is MS SQL and where do I install the driver
BR Soren

Can anybody help me with the syntax for accessing MS
SQL db from JSP???
This is what I do when I use MySQL:
Class.forName( "org.gjt.mm.mysql.Driver" );
Connection conn = DriverManager.getConnection(
"jdbc:mysql:://um" ,
What do I write when it is MS SQL and where do I
install the driver
BR Soren
One way of doing this is to use ODBC. Here's an example:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn = DriverManager.getConnection("jdbc:odbc:<odbc name>", "<login>", "<password>");

Similar Messages

  • When I go through the 'import favorites' from Internet Explorer, everything seems to progress correctly. However, when I click on Bokkmarks, there is no option in the menu for accessing the imported items form EI. Is there a fix for this?

    When I go through the 'import favorites' from Internet Explorer, everything seems to progress correctly. However, when I click on Bokkmarks, there is no option in the menu for accessing the imported items form EI. Why would this option be missing and is there a fix for this?

    Hello Nigel.
    Are you sure the Bookmarks you important are nowhere to be found? They should be stored in your bookmark manager, somewhere. To access the bookmark manager, go into ''Bookmarks > Organize Bookmarks...''. Try searching there.
    You can change their place from there too.

  • I want to impersonate user when I access Microsoft SQL Server from powershell

    Hi,
    Actually I have to perform some SQL operation on my MSSQL server database. but problems is that I have given all credentials (windows fix login/password which can access database) in connection string. but when I execute the script then it is always using
    my windows login and password and then giving error that not able to connect with it.
    My personal windows credentials does not have access to my enterprise database that is why I am using service ID.
    I came to know that I have to do user impersonation of user when i access database but how to do that?? can you guys give me the syntax for that as i have to perform all sql operation using impersonation.
    Please reply me as soon as possible as i stuck since long
    Vipul Mistry Sr. Embedded Engineer www.eInfochips.com

    Hi Guys,
    thanks a lot for your support and replies but I found the solution. With below code i was able to do my task and I used $AuthType =3 for my purpose. Hope this will help others also.
    $varDBServer = "N0SQL104,1675"
    $varDBInstance = ""
    $varDBSchema = "Data_Dev"
    $varDBUser = "S0060VMSD"
    $varDBPassword = "SDCFG345D"
    #### Choose authentication type (0=SSO, 1= SQL, 2=Domain)
    $AuthType = 3
    #### Load the required assembly for sql server administration
    #### Requieres SQLServerNativeClient, SQLSysClrTypes and SharedManagementObjects
    [reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null
    $varSQLServer = New-Object -typeName Microsoft.SqlServer.Management.Smo.Server -argumentList "$varDBServer\$varDBInstance"
    switch ($AuthType) {
    1 {
    #### Access the SQL-Server with your current credentials (pass-through)
    $varSQLServer.ConnectionContext.LoginSecure = $true
    2 {
    #### Access the SQL-Server with SQL-Server credentials in mixed mode authentications
    $varSQLServer.ConnectionContext.LoginSecure = $false
    $varSQLServer.ConnectionContext.Login = $varDBUser
    $varSQLServer.ConnectionContext.Password = $varDBPassword
    3 {
    #### Access the SQL-Server with given domain user credentials
    $varSQLServer.ConnectionContext.LoginSecure = $true
    $varSQLServer.ConnectionContext.ConnectAsUser = $true
    $varSQLServer.ConnectionContext.ConnectAsUserName = $varDBUser
    $varSQLServer.ConnectionContext.ConnectAsUserPassword = $varDBPassword
    } default {
    Write-Host "Please select an authentication type: 0=SSO, 1= SQL, 2=Domain"
    exit -1
    #### Try connection to SQL-Server with given parameters
    Write-Host "`nTry connection to SQL-Server with given parameters`n"
    try {
    $varBuildOfSQLServer = $varSQLServer.Version.get_Build()
    Write-Host "Build of SQL-Server '$varDBServer' is $varBuildOfSQLServer"
    } catch {
    Write-Host "ERROR: Cannot access SQL-Server '$varDBServer'. Exit script!"
    exit –1
    Vipul Mistry Sr. Embedded Engineer www.eInfochips.com

  • Write the syntax for declaring table control in dialog programming?

    1) Write the syntax for declaring table control in dialog programming?
    2) Write the syntax to call a selection screen in a modal dialog box?

    hi,
    check this code for table control.
    DIALOG PROGRAMMING
    TABLE CONTROL
    IN SE51
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0100.
    LOOP AT ITVBAK WITH CONTROL TABCTRL. ##  TABLE CONTROL NAME
    ENDLOOP.
    PROCESS AFTER INPUT.
    MODULE USER_COMMAND_0100.
    LOOP AT ITVBAK.
    ENDLOOP.
    IN PAI FLOW LOGIC
    PROGRAM YMODULE_PR4 .
    TABLES : KNA1, VBAK.
    DATA : BEGIN OF ITVBAK OCCURS 0,
           VBELN LIKE VBAK-VBELN,
           ERDAT LIKE VBAK-ERDAT,
           ERNAM LIKE VBAK-ERNAM,
           NETWR LIKE VBAK-NETWR,
           END OF ITVBAK.
    CONTROLS : TABCTRL TYPE TABLEVIEW USING SCREEN '0100'.
    TO ACTIVATE SCROLL BAR
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
      CASE SY-UCOMM.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
        WHEN SPACE.
          SELECT VBELN ERDAT ERNAM NETWR
            FROM VBAK
            INTO TABLE ITVBAK
           WHERE KUNNR = KNA1-KUNNR.
          TABCTRL-LINES = SY-DBCNT.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0100  OUTPUT

  • How to change the CORE-id/ Access server audit time from GMT to local

    When we enabled the auditing for CORE-Id and Access server, we noticed a mismatch on the time stamp. The ‘eventDateAndTime’ field for CORE-id server has audited the event in local time while the same for Access server is audited as GMT time. We wanted to make it consistent for both the servers; preferably to the local time.
    Any idea, How to do it?

    Hello,
    Try using this
    rd = new ReportDocument();
            rd.Load(Server.MapPath("CrystalReport1.rpt"));
            cninfo = new ConnectionInfo();
            //Name of server to which you want to change to runtime
            cninfo.ServerName = "D-3206";
            //Name of database to which you are changing
            cninfo.DatabaseName = "tempdb";
            //username
            cninfo.UserID = "sa";
            //password
            cninfo.Password = "sa";
            crDatabase = rd.Database;
            crTables = crDatabase.Tables;
            foreach (CrystalDecisions.CrystalReports.Engine.Table crTable in rd.Database.Tables)
                // Get the TableLogOnInfo from the Table and then set the new
                // ConnectionInfo values.
                TableLogOnInfo crLogOnInfo = crTable.LogOnInfo;
                crLogOnInfo.ConnectionInfo = cninfo;
                // Apply the TableLogOnInfo
                crTable.ApplyLogOnInfo(crLogOnInfo);
                // Set the location of the database. This value will vary from          // database to database.
                crTable.Location = crTable.Location; //"DATABASE.OWNER.TABLENAME";
    CrystalReportViewer1.ReportSource = rd;
    Thanks,
    Bhushan.

  • The file to download the app for Android is not working from my phone--it says that the file isn't there. However it does see the one for the Iphone (even though it can't use it). I'm very computer literate and am pretty sure the problem is on your end.

    The file to download the app for Android is not working from my phone--it says that the file isn't there. However it does see the one for the Iphone (even though it can't use it). I've tried it multiple times and continue to get the same message: "NOT FOUND The requested item could not be found". I also tried through the Market application on the phone but ended-up with the same result.
    I'm very computer literate and am pretty sure the problem is on your end. If this is the case then no one can download the app. I considered that perhaps because it's still in Beta that it was removed due to some other type of software issue. I would really like to use Firefox on my new Droid (2.0); when with this be available?

    Firefox will not appear in the Market for most phones with incompatible hardware. You can check if your phone is supported here:
    https://wiki.mozilla.org/Mobile/Platforms/Android
    Even on some supported devices, a bug in the Market software prevents Firefox from showing up. This may be related to the fairly recent Android Market app update. If you go to Settings/Applications/Market and choose "Uninstall" you can uninstall the update, and then search for and install Firefox from the marketplace.
    Or, if you have a supported phone, you can download the app directly by typing this address into your phone's browser: http://bit.ly/fxbeta3
    (Note: To download the app directly for an AT&T phone, you will have to search for instructions on "sideloading" the APK file, since AT&T disables the option to install from non-Market sources.)

  • HT3819 homesharing stops when computer sleeps. I already checked the "wake for access". What is wrong?

    Homesharing stops when the computer sleeps. Already checked the " wake for access" and already changed the computer sleep to never.

    I have tried everything I could to fix this, but some things require actually being on Firefox, and since I cannot get on, I cannot click on the tabs to do it. I have even totally uninstalled firefox, and that has not fixed this. I still get the same message that firefox is running and I need to close it or restart (which I have also tried dozens of times). I have removed things like Java, and that has not helped either. If I cannot even get on line in firefox, how can I fix this. I am not crazy about using internet explorer, but right now, it is my only option. I even tried to start in safe mode, and the same message box pops up!

  • What's the..   I bought the app for 1dollar, but you take from me 3 dollars???

    What's the..   I bought the app for 1dollar, but you take from me 3 dollars???

    Posted the wrong link.
    This is the right link.
    How to report an issue with Your iTunes Store purchase
    Message was edited by: b j t

  • How can I get the shortcut for forced quite to work from my keyboard.

    The shortcut for forced quite stopped working from my apple keyboard.  Is there any way I can reprogram it or do I need a new keyboard? When I use a logiteck keyboard the shortcut works.  the esc key, command key, and option key work it just doesn't work as the short cut.  Any help would be great, I don't want to buy a new keyboard.
    We did just have the video card replaced, not sure if that would effect anything.
    Thanks

    The Apple keyboard has two Command and two Option keys. Did you try them all and in every different combination possible to rule out a defective key. You could also go Fullscreen and use Escape to exit Fullscreen to rule that one out. It reads like the keyboard is on its way out if the Logitech keyboard works. Also that would indicates that it's not a problem on the OS side. Hope that helps

  • HT4623 SOMEHOW the icon for rotation lock is missing from the control bar. I tried to reset but my passcode doesn't work. First, how do I find my passcode? Then, if I reset, will it return the rotation lock to the control bar?

    I don't know how it happened why, but the icon for rotation lock is missing from the control bar. Second problem, the passcode for my iPad isn't working. I wrote it down, so not sure what the problem is. HELP

    If the setting for the rotation lock is missing it is because you are using the side switch to control the rotation in Settings>General>Use Side Switch to>Lock Rotation. The software switch in the control center should be for Muting system sounds.
    you have to restore the iPad in orde to unlock it now.
    iOS: Forgotten passcode or device disabled after entering wrong ...
    If you are sure that you are entering the correct passcode, reboot the iPad and then try again and see if it is accepted.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • How can I make "No Proxy" the default for accessing the internet?

    How can I make "No Proxy" the default for accessing the internet?

    *Tools > Options > Advanced > Network : Connection > Settings
    If you do not need to use a proxy to connect to internet then try to select "No Proxy" if "Use the system proxy settings" or one of the others do not work properly.
    See "Firefox connection settings":
    *https://support.mozilla.org/kb/Firefox+cannot+load+websites+but+other+programs+can

  • Can anyone tell me the syntax for sendkeys

    Can anyone tell me the syntax for sendkeys-sbo_application.SendKeys("+()") is
    not working

    Hi,
    Have you seen the folowing messages?
    Re: Tab key and lookup table
    Sendkeys("+({TAB})")
    Hope it helps
    Trinidad.

  • For the Calendar clients, the options for Access Rights

    For the Calendar clients, the options for Access Rights
    <P>
    The default setting for Tasks, under Access Rights is Normal and
    Personal. This means that anyone who views your Tasks will see your
    normal ones and your personal ones.
    <P>
    If you want your personal Tasks hidden go to:
    <P>
    Access Rights | Tasks | Uncheck "Personal"

    hello, please try to [[Reset Firefox – easily fix most problems|reset firefox]] and see if this can address the issue...

  • Need coding support for Accessing MYSQL stored procedure from java

    Hi every one,
    I need coding support for accessing Mysql stored procedure from java and JSP.
    Please help me
    pranav

    You'd better have a recent version of MySQL, because earlier ones didn't support stored procs.
    If your MySQL and driver support stored procs, maybe you just need a JDBC stored proc tutorial.
    %

  • TS3274 My ipad 2 charges very, very slow. It was on the charger for 7 hours and went from 41% charged to 77% charged.

    My ipad 2 is charging very, very slow. Is was on the charger for 7 hours and went from 41% to 77%. I have tried several different charger, even purchased a new charger. What could the problem be?

    Could be your battery needs replacing.
    First thing to try is to reset your device. Press and hold the Home and Sleep buttons simultaneously ignoring the red slider should one appear until the Apple logo appears. Let go of the buttons and let the device restart. See if that fixes your problem.

Maybe you are looking for