JSP read and write data in MS-SQL database

I am new to JSP. I need to write JSP page to read and write data in MS-SQL Database. I wonder if it is different from other database. I couldn't find useful pointers in the web. Please advise. Thanks!!

Sure, SQL Server is different from Oracle is different from MySQL is different from...
But all of them can be accessed using JDBC:
http://java.sun.com/docs/books/tutorial/jdbc/
Maybe you should learn about that for starters.
You can use SQL tags from JSTL in your JSPs. I'd recommend JSTL highly. No scriptlet code that way. - MOD

Similar Messages

  • Read and write data from content repository .

    Hi All,
    We are using content repository to store some document and images on web center server .
    So we have created/setup a content repository on web center .
    Please proivde me some documnet /wiki page to get some idea how can i read and write date in
    content repository .
    You are most welocme to provide some idea /suggestion .
    Thanks,
    Arun.

    Have you already configured webcenter spaces so it can use content server?
    Have you installed the content server seperatly from webcenter or as a part of the webcenter installation?
    Check if you have the webcenter spaces component installed in content server because without i don't think it will work...
    If you already have configured UCM to work with spaces it's quiet easy.
    From your groupspace, open the settings page of your groupspace. Go to the services tab. In the left hand side you can enable the documents services. WHen you have done that, you are able to add the document services taskflows to your pages. Just go to a page in your pagegroup and edit it. Open the resource catalog and you will find some extra taskflows you can add.
    If you haven't configured UCM and webcenter to work together, here some steps that will help you:
    * Integrating UCM with Spaces
         * They both need to use the same LDAP store.
         * Since there is no LDAP server available, we choose for embedded WLS LDAP.
         * Integrating the ucm into apache
              * Stop UCM
              * In /oracle/product/wls10320/WebCenter/ucm/config/config.cfg, check the SocketHostAddressSecurityFilter to contain 127.0.0.1
              * Add the SocketHostAddressSecurityFilter to /oracle/product/wls10320/WebCenter/ucm/admin/bin/intradoc.cfg
              * Add to /oracle/product/wls10320/WebTier/instances/instance1/config/OHS/ohs1/httpd.conf
                   include /oracle/product/wls10320/WebCenter/ucm/data/users/apache22/apache.conf
              * Change the mod_wl_ohs.conf file to
                   <IfModule weblogic_module>
                         WebLogicHost localhost
                         WebLogicPort 7001
                         Debug ON
                         WLLogFile /tmp/weblogic.log
                   </IfModule>
                   <Location /webcenter>
                      SetHandler weblogic-handler
                      WebLogicCluster localhost:8888
                   </Location>
                   <Location /webcenterhelp>
                      SetHandler weblogic-handler
                      WebLogicCluster localhost:8888
                   </Location>
                   <Location /owc_discussions>
                      SetHandler weblogic-handler
                      WebLogicCluster localhost:8890
                   </Location>
                   <Location /em>
                      SetHandler weblogic-handler
                   </Location>
                   <Location /console>
                      SetHandler weblogic-handler
                   </Location>
                   <Location /consolehelp>
                      SetHandler weblogic-handler
                   </Location>
              * Restart UCM & WebTier
              * Test URL: http://yourServer:7777/idc
         * Configure the Identity Store for UCM & WebCenter
              * Set the password for the embedded ldap in WLS
                   Console => Domain Name => Security tab => Embedded LDAP tab => reset credentials
              * Restart AdminServer
              * Stop UCM
              * Add the following to /oracle/product/wls10320/WebCenter/ucm/config/jps-config.xml
                      <serviceInstance name="idstore.oid" provider="idstore.ldap.provider">
                          <property name="subscriber.name" value="ou=myrealm,dc=webcenter_domain"/>
                          <property name="idstore.type" value="WLS_OVD"/>
                          <property name="security.principal.key" value="ldap.credential"/>
                          <property name="security.principal.alias" value="JPS"/>
                              <property name="ldap.url" value="ldap://yourServer:7001"/>
                          <extendedProperty>
                              <name>user.search.bases</name>
                              <values><value>ou=people,ou=myrealm,dc=webcenter_domain</value></values>
                          </extendedProperty>
                          <extendedProperty>
                              <name>group.search.bases</name>
                              <values><value>ou=groups,ou=myrealm,dc=webcenter_domain</value></values>
                          </extendedProperty>
                          <property name="username.attr" value="uid"/>
                          <property name="user.login.attr" value="uid"/>
                          <property name="groupname.attr" value="cn"/>
                      </serviceInstance>
              * In the same file, change the serviceInstanceRef ref="idstore.ldap" to "idstore.oid"
              * Go to /oracle/product/wls10320/WebCenter/ucm/custom/FustionLibraries/tools
              * ./run_credtool.sh
                   Alias: default
                   Key: default
                   User Name: cn=Admin
                   Password: weblogic123
                   JPS Config: default
              * Start UCM
              * Check Provider:
                   * Go to http://yourServer:7777/idc
                   * Login : sysadmin/idc
                   * Administration -> Providers
                   * jpsuser should be good
                   * When a ldapuser exist, disable it!!
         * Configuring UCM for content search
              * Change the file /products/WebCenter11gR1/WebCenter/ucm/config/config.cfg
                  SearchIndexerEngineName=DATABASE.METADATA to SearchIndexerEngineName=DATABASE.FULLTEXT
              * Restart UCM server
              * Run the /products/WebCenter11gR1/WebCenter/ucm/database/oracle/admin/batchsnippet.sql in the wcbepsc_ocserver schema
              * Restart UCM server
              * Open the /products/WebCenter11gR1/WebCenter/ucm/bin/RepositoryManager (sysadmin/idc)
              * Recreate the indexes
         * Registering UCM with WebCenter
              * Go to http://yourServer:7777/em
              * Login with weblogic/weblogicPassword
              * Go to WebCenter - WebCenter Spaces - webcenter (WLS_Spaces)
              * From the top menu, select Settings - Service Configuration     
              * Select Content Repository
              * Add
                   Connection Name: ucm_connection
                   Repository Type: Oracle Content Server
                   Active Connection: checked
                   Administrator User Name: sysadmin
                   Root Folder: /WebCenterSpaces
                   Application Name: Spaces
                   CIS Socket Type: Socket
                   Server Host: localhost
                   Server Port: 4444
                   Authentication Method: Identity Propagation
              * Restart WLS_Spaces
         * Test the connection by creating a new group space and upload a document to the document page of this group spaceHope this helps.

  • How to read and write data in to a specified range of cells(it include multiple row & columns) in excel

    How to read and write data in to a specified range of cells(it include multiple row & columns) in excel

    CVI Comes with a sample project that explains how to read/write to a Excel file: choose "Explore examples..." in CVI welcome page and navigate to <cviSampleDir>\activex\excel folder where you can load excel2000dem.prj.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • How to read and write data from json file from windows phone7 app

    Hi
    I am developing wp7 app for the use of students my questions are
    How can i write a code to read and write the json/text file for the wp7.
    I am using windows 7 OS, VS 2010 Edition.
    This is my code below:
    xaml:
    <Grid>
                        <TextBlock Height="45" HorizontalAlignment="Left" Margin="7,18,0,550" Name="textBlock1" Text="Full
    Name: " />
                        <TextBox Width="350" Height="70" HorizontalAlignment="Left" Margin="108,1,0,0" Name="txtName"
    Text="Enter your full name" VerticalAlignment="Top" />
                        <TextBlock Height="45" HorizontalAlignment="Left" Margin="6,75,0,0" Name="textBlock2" Text="Contact
    No: " VerticalAlignment="Top" />
                        <TextBox Width="350" Height="70" HorizontalAlignment="Left" Margin="108,61,0,480" Name="txtContact"
    Text="Enter your contact number" MaxLength="10" />
                        <Button Content="Register" Height="72" HorizontalAlignment="Left" Margin="10,330,0,0" Name="btnRegister"
    VerticalAlignment="Top" Width="190" Click="btnRegister_Click" />
                    </Grid>
    xaml.cs:
    private void btnRegister_Click(object sender, RoutedEventArgs e)
                string name, contact;
                name = txtName.Text;
                contact = txtContact.Text;
                try
                    if (name != "" && contact != "")
                        string msg = name + " " + contact;
                        MessageBox.Show(msg);
                        Student stud = new Student
                            Name= name,
                            Contact = contact,
                        string jsonString = JsonConvert.SerializeObject(stud);
                        MessageBox.Show(jsonString);
                    else
                        MessageBox.Show("Input Proper Information", MessageBoxButton.OK);
                catch (Exception ex)
                    MessageBox.Show(ex.Message);
    I have download NewtonSoft.json version 5.0.8.
    So, I am able to convert input data into json format, but how can I able to write and read this data from a json/text file.
    How can I do?
    Thank you in adv and please, reply soon.

    We don't have many samples left for Windows Phone 7 + Azure, the closest one to what you want to do is probably:
    Using Local Storage with OData on Windows Phone To Reduce Network Bandwidth
    this sample uses the local database feature: 'LINQ to SQL', available to Windows Phone 7.1 and 8.0 Silverlight applications, instead of simple file storage but even if you choose to stick with simple file storage I believe you should be able to adapt the
    networking related portions of the sample to your particular application.
    Eric Fleck, Windows Store and Windows Phone Developer Support. If you would like to provide feedback or suggestions for future improvements to the Windows Phone SDK please go to http://wpdev.uservoice.com/ where you can post your suggestions and/or cast
    your votes for existing suggestions.

  • Read and Write data in iphone app

    I want to build a simple offline mobile app which reads and writes or stores info to a file, xml, json, txt or whatever.
    What is the best way to do this?
    I am currently learing jQuery and PHP, so I don't want to have to learn some other million things that does one thing but not another.
    Can this be achived without objective C? Can i do this with Jquery and phone Gap?
    Thanks

    Do a search for 'HTML 5 Storage' and you'll find a bunch of resources that will help. Here's a few
    http://www.w3schools.com/HTML/html5_webstorage.asp
    http://diveintohtml5.info/storage.html
    http://htmlpad.wordpress.com/2010/03/10/html-5-data-storage-javascript-api-on-ipad-and-iph one/

  • Read and write data from virtual port (bluetooth adaptor)

    Hi,
    I want to read and wirte data to the bluetooth adaptor by java. I connected my bluetooth adapter to COM3.(virtual port). Anybody help me with this.I need very urgent.
    Thanks,
    with regards,
    thelay

    Deepa_05 wrote:
    Hi,
    I didn't get jar fileAnd?

  • How to read and write data from Excel to TestStand without using LabVIEW VIs

    Hi,
    How can I read in columns of data from Excel into a TestStand array and write columns of data to Excel from TestStand without using LabVIEW VIs?
    I don't think the Property Loader custom step type in TestStand will work because the data I would like to read in from Excel is in a column that is thousands of rows long and the data has to be in the proper format to use the Property Loader to load in an array from Excel.
    Thanks for your help.

    That example does not use LabVIEW and it does about 40% of what you need to do by calling Excel through ActiveX. If you don't know how to use Excel through ActiveX then you'll need to brush up on that.
    http://www.microsoft.com/en-us/download/details.aspx?id=16250
    http://support.microsoft.com/kb/141759
    http://support.microsoft.com/kb/302084
    CTA, CLA, MTFBWY

  • Read and write data from / to cube in CUSTOM_LOGIC BADI

    Here are the details:
    BPC displays a set of details - with 5 rows and 5 columns. There are 50 additional rows for the 5 columns which are blank to start with.
    User changes a cell. BPC 10 only sends that cell which is changed by the user in CUSTOM_LOGIC and WRITE_BACK BADIs.
    I need to get other 5 X 5 cells (other than 1 cell, which is changed and being passed in the BADIs) details to determine all the details and calculate the additional 50 rows. After calculating these values, i need to update the cube so that the BPC report refreshes with the data i have updated.
    Whats the best way? What are the funtion modules involved in reading / writing? Are there any best practices to read / write data from cube.
    Appreciate your help.

    Hi Ravan,
    Look at my sample write back badi here: http://scn.sap.com/message/14290977#14290977
    At the end of the code I have values updated in ct_data. The contents of ct_data will be automatically written to the cube (you don't need to have special code to write data).
    B.R. Vadim

  • How to read and store data from an SQL resultset

    I'm writing a program to create testing scripts. I have a working version of the program that takes data from a specific input file, processes it and then outputs it as a test file that is readable by this other system. That's all fine and dandy, but now I wish to extend my program so that it doesn't need the input file, it shoud run an SQL query on the database itself and output this, with some other data to the output file, I have been experimenting with some code below:
              ResultSet rset;
              rset = sql.sqlweight();
              while (rset.next()!= false)
                   System.out.println("I'm getting to this loop");
                   scanCode = rset.getString(1);
                   System.out.println(scanCode);
                   rset.next();
              }And method sqlweight looks like this:
         public static ResultSet sqlweight() throws SQLException
              Connection connectiona = DriverManager.getConnection(//hiding connection details);
              Statement stmtW = connectiona.createStatement();
              String sqlW = "Select distinct (selc_code) from selling_code, prod_orgu_link where selling_code.prod_id = prod_orgu_link.prod_id and prod_orgu_link.prou_prod_handling = 20";
              ResultSet rset = stmtW.executeQuery(sqlW);
              while (rset.next())
                   //System.out.println(rset.getString(1));
              //rset.close();
              //stmtW.close();
              //connectiona.close();
              return rset;
         }Code is a bit messy at the moment as I am constantly changing and adding things so excuse the formatting. I can't get it to enter the loop (hence the testing line I put in it). I am wondering what the best way would be to get the data held in the results set into my String variable scanCode. Thanks for any help or advice.

    I haven't thrown it away, it just looks like this now:
         public static ResultSet sqlweight() throws SQLException
              Connection connectiona = DriverManager.getConnection(//hiding connection details);
              Statement stmtW = connectiona.createStatement();
              String sqlW = "Select distinct (selc_code) from selling_code, prod_orgu_link where selling_code.prod_id = prod_orgu_link.prod_id and prod_orgu_link.prou_prod_handling = 20";
              ResultSet rset = stmtW.executeQuery(sqlW);
              return rset;     
         }

  • Read and write data at different rates, parallel loops.

    Machine monitoring and datalogging application.
    imple question, maybe not so simple answer.
    I want to read fieldpoint channels at a certain rate, say every 2 seconds, so I can verify satisfactory operating conditions of a machine under test.
    I then want to write these values to a file at less frequent intervals, say once an hour, as I have no need to record all the data if the machine is running correctly.
    I thought parallel loops with "wait until next ms multiple" would be the way to go, but I am having trouble ensuring that the slower loop actually grabs the values I need. I am not clear on the intricacies of shared variables, local variable, and queues and not sure which way I need to go.
    Semaphores didn't seem to work for me as the faster loop grabbed control and the slower loop couldn't sneak in to read its values.
    Any help would be much appreciated,
    Thanks

     I would use a queue.  As you gather data, enqueue the data.  In the slower loop, process the data queued so far by reading from the queue until it is empty.  You can use the Queue Status vi and then flush the queue to get ready for new data.
    Here is some sample code to get you started.
    Message Edited by tbob on 08-06-2007 06:00 PM
    Message Edited by tbob on 08-06-2007 06:01 PM
    - tbob
    Inventor of the WORM Global
    Attachments:
    Queue.png ‏8 KB

  • How can we read and write data into plist using javascript in a html5 widget to be implemented into iBooks?

    I had been trying to read from a plist to get file names of data files and it works fine when i run it in safari but after making its widget and putting it into iBooks it doesnot works. Please tell me any new method to read p list or correct my function if there is any correction. my function is following.
    function plistread(n)
              if (window.XMLHttpRequest)
                   xhttp = new XMLHttpRequest();
               else
            xhttp = new ActiveXObject("Microsoft.XMLHTTP");
                   xhttp.open("GET", "Spell_Check_3.plist", false);
        xhttp.send();
        xmlDoc = xhttp.responseXML;
        var x = xmlDoc.getElementsByTagName("dict");
        var imgnamex = x[n].getElementsByTagName("string")[0].childNodes[0].nodeValue;
        xlength=x.length;
              return imgnamex;

    See i need to access a plist file in my html5 widget, i implemented it in java script but it's not working so is there any other way to take out values from a plist file.

  • How to read and write data to a user defined table?

    I have created a srf with 2 edit box and a ok buttin, I want to insert data to the user defined table i created using sql query while i press OK button..
    Please provide the complete code to insert and select da from the user defined table.

    Hi,
    You can use the code below.
    Dim ret As Long
    d
    Private Sub Add_Table_Click()
        Dim oUserTablesMD As SAPbobsCOM.UserTablesMD
        Set oUserTablesMD = oCompany.GetBusinessObject(oUserTables)
        ' When adding user tables or fields, use a prefix
        ' identifying your partner name space. This will
        ' prevent collisions from different partner add-ons
        ' SAP's name space prefix is "BE_"
        'Set the two mandatory fields
        oUserTablesMD.TableName = "T1"
        oUserTablesMD.TableDescription = "Table1"
        'Add the table (which contains 2 default, mandatory fields, 'Code' and 'Name')
        ret = oUserTablesMD.Add
        If ret <> 0 Then
            oCompany.GetLastError ret, Str
            MsgBox Str
        Else
            MsgBox "Table: " & oUserTablesMD.TableName & " was added successfully"
        End If
    End Sub
    Private Sub Add_UDF_Click()
        Dim oUserFieldsMD As SAPbobsCOM.UserFieldsMD
        Set oUserFieldsMD = oCompany.GetBusinessObject(oUserFields)
        oUserFieldsMD.TableName = "T1"
        oUserFieldsMD.Name = "AlbUDF"
        oUserFieldsMD.Description = "Albert UDF"
        'Add the field to the table
        lRetCode = oUserFieldsMD.Add
        If lRetCode <> 0 Then
            oCompany.GetLastError ret, Str
            MsgBox Str
        Else
            MsgBox "Field: '" & oUserFieldsMD.Name & "' was added successfuly to " & oUserFieldsMD.TableName & " Table"
        End If
    End Sub
    Private Sub Add_Data_Click()
        Dim oUserTable As SAPbobsCOM.UserTable
        Set oUserTable = oCompany.UserTables.Item(1)
        oUserTable.GetByKey ("T1")
        'Set default, mandatory fields
        oUserTable.Code = "A"
        oUserTable.Name = "Albert"
        'Set user field
        oUserTable.UserFields.Fields.Item("U_AlbUDF").Value = "1"
        oUserTable.Add
        If ret <> 0 Then
            oCompany.GetLastError ret, Str
            MsgBox Str
        Else
            MsgBox "Value to field: '" & oUserTable.UserFields.Fields.Item("U_AlbUDF").Name & "' was updated successfuly to " & oUserTable.TableName & " Table"
        End If
    End Sub
    Regards,
    Noor

  • Read and write excel sheet data from uploded file in sharepoint site programmatically 2013

    hi team,
    I am working on sharepoint 2013.I want to read and write data in excel sheet (micrsoft excel) from stored file in shrepoint docoumnt library .please suggest me
    vijay

    Hi
    Vijay,
    check those links
    http://www.sharepointwithattitude.com/archives/61
    https://social.technet.microsoft.com/Forums/en-US/e760051b-a92f-473c-9ec9-0f0c36c99e40/read-and-write-excel-sheet-data-from-uploded-file-in-sharepoint-site-programmatically-2013?forum=sharepointdevelopment
    Kind Regards, John Naguib Technical Consultant/Architect MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation. Please remember to mark the reply as answer if it helps.

  • How to read and write Unicode text with MS Access?

    Hi all, I'm new to Java, so please forgive me if my question is too ... ^_^
    I'm writing a small program that read and write data with MS Access. However, when I insert Unicode text into the database, it has wrong encoding like this "h?y l? n?m".
    Please tell me how to fix this.
    Thanks in advance!

    The following forum thread might be enlightening:
    http://forum.java.sun.com/thread.jspa?threadID=573855&messageID=2870785
    I myself do not use MS Access, but a PreparedStatement is in general the best option.
    You can set parameters in the SQL which then get converted and even protected against SQL injection hacking.

  • How do I read and write to text files on a remote computer's hard drive

    I would like to read and write data to a text file on a remote computer. This is easily accomplished using one of the file functions such as "write characters to file.vi". If I am already connected to the remote computer, all I need to do is specify the path to the particular file and it will work fine.
    My problem is that I want to connect to the remote computer programatically within LabVIEW (I do not want to have to use the computer's OS to establish the connection. Is there a function that I can use to do this?
    Thomas D. Schaefer
    Wells Manufacturing Corp

    Yariv,
    You should really start a new thread with a new question like this, so that more people see it. Some people look primarily at threads that have no responses yet. Also, don't post the exact same question in multiple places. Or, if you must cross-post to some other forum, make sure to mention it in your question text.
    I'm happy to be a brick in your Western Wall, but I'm not sure what the main objective is here. Is the main problem really getting access to the "X bytes received in Y seconds at Z bytes/sec" string? Or is it accomplishing the file transfer? And what OS and LabVIEW version are you running?
    I think your problem is that you the LabVIEW System Exec command does not allow for the degree of interactivity that you need if you want to issue a sequence of commands to a command-line executable. However, under Windows XP (and, presumably, other Windows versions, though I can't check), you can tell the FTP executable to use commands from a textfile script by using the -s switch, and you can override the prompts during multiple file transfers with the -i switch:
    ftp -i -s:FILEPATH SERVERNAME
    If you issue a command in this format to System Exec, and make sure to create a file at FILEPATH with your command sequence (one per line), then you should at least accomplish the FTP actions. This won't give you the transfer details in the standard output, unfortunately. However, if you just want a general sense of how much was transferred and how quickly it happened, you can code that in LabVIEW by getting the resulting file sizes and using Tick Count before and after the System Exec call to see how long the transfer took.
    Hope that helps,
    John

Maybe you are looking for

  • How do I get a small (Sony handycam) DVD out? from my iMac

    In order to see if the iMac would import Sony Handycam DVD (small size) I put in such a small DVD... it's still there, it not recognized, and it will not come out. What can I do? /Lars

  • Post Your's 3DMark 2001 scores HERE

    I would like to verify my 3DMark 2001 SE (v.330). Post your's results with complete system description (drivers versions, ram timings, overclock settings (if any), ect.) Here is my Baby: - Athlon 3200 (2210 MHz - NC core, no OC) - MSI K8N NEO Platinu

  • Monitoring HTTP receiver adapter ?

    Hi Guys, How to monitor the HTTP adapter ? How can we know when any errors in the HTTP adapter ?  Do i need to look in the integration engine ? Thanks, srini

  • Audio Level

    Hi Everyone: What is the Optimum level of audio in Final Cut pro and how would I be able to set it in my project before I start? I need to give this project on the Mini TAPE. I was told that my audio is sometimes to high or sometimes very low how wou

  • Re-activate CS3 on a new computer.

    I have bought a new laptop and want to install CS3 on it.  There was not option to deactivate on my old desktop.  The error I get is "the serial number is not valid".  I am the original owner of the CS3 software.