How to connect to a Oracle database ?

12 posts, 0 answers
  1. Shounak
    Shounak avatar
    2 posts
    Member since:
    Aug 2011

    Posted 26 Aug 2011 Link to this post

    Hi ,

    I am loving this site ever since I had stumbled upon it while googling . Awesome job , I must say.

    But , I am facing some problem regarding datasource, In most of the examples , it has been used as JSON or XML database.

    Can I connect without using XML or JSON ?



    Keep up the good work.

    Thank you.

  2. life
    life avatar
    1 posts
    Member since:
    Sep 2011

    Posted 01 Sep 2011 Link to this post

    About this,I think the javascript can not operate the Database it is not a server language,you can use like php  java or other to operate database and make json or xml.
  3. Kendo UI is VS 2017 Ready
  4. Pasi
    Pasi avatar
    2 posts
    Member since:
    Sep 2011

    Posted 15 Sep 2011 Link to this post

    Hello,

    This might be a bit newbie question but how do I pass and read JSON dataSource parameters in PHP?
    ----
    var dataSource = new kendo.data.DataSource({
                            transport: {
                                read: {
                                    url: "http://example.com/test.php", // the remove service url
                                    dataType: "json", // JSONP (JSON with padding) is required for cross-domain AJAX
                                }
                            },
                            data: {
                            status: 2
                            },
                            schema: { // describe the result format
                                data: "results" // the data which the data source will be bound to is in the "results" field
                            },
                            change: function() { // subscribe to the CHANGE event of the data source
                                $("#tweets").html(kendo.render(template, this.view()));
                            }
                        });
  5. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 20 Sep 2011 Link to this post

    @Shounak- @life is correct. Kendo UI is a JavaScript framework that runs in the browser. It does not have the ability to directly talk to database servers (for obvious security reasons). Instead, you can use any server-side framework and language, like PHP or .NET, to query your data from Oracle and then return it to your page via a JSON or XML web service. This is the standard pattern for any data service with JavaScript-powered sites and apps.

    @Pasi- We will eventually provide server-side wrappers for PHP (and other languages) to make this process even easier. For now, you can simply use server-side code to "inject" static values in to your JavaScript configuration on the server, and then when the final HTML gets sent the browser, Kendo UI will initialize with these values.

    For example, if you were trying to configure the data source with a server-side value for "status," then you might have PHP code like this:

    var dataSource = new kendo.data.DataSource({
          transport: {
                read: {
                      url: "http://example.com/test.php",
                      dataType: "json",
                 }
           },
          data: {
                status: "<?php echo $phpvar ?>"
          }...
    });

    Where $phpvar is the PHP variable with the value you want rendered in the script configuration.

    Hope that helps.

    -Todd
  6. Shounak
    Shounak avatar
    2 posts
    Member since:
    Aug 2011

    Posted 21 Sep 2011 Link to this post

    @Todd : Does Kendo UI support J2EE ? or is it only for PHP ?

    I have to design my project in J2EE . Can I do like this as you have mentioned :

    var dataSource = new kendo.data.DataSource({
          transport: {
                read: {
                      url: "http://example.com/test.jsp",
                      dataType: "json",
                 }
           },
          data: {
                status: "<%= jspvar %>"
          }...
    });
  7. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 21 Sep 2011 Link to this post

    I'm not as familiar with J2EE, but in theory, if your code example is just writing values to the page output, then yes! Again, Kendo UI is a front-end framework that runs in the browser. You can use any server-side framework you like to manipulate the HTML/JavaScript before it reaches the browser:

    J2EE, Rails, ASP.NET WebForms/MVC, PHP, Python, Ruby, whatever

    The syntax will change with the different frameworks, but the concept remains the same.

    To be clear, a server framework is not required to use Kendo UI- you can do everything with static HTML and JavaScript. But if you want dynamic configuration, the example here should help show the way.

    -Todd
  8. Pasi
    Pasi avatar
    2 posts
    Member since:
    Sep 2011

    Posted 22 Sep 2011 Link to this post

    Thanks Todd for your reply.

    You can send parameters to PHP by calling the read method with parameters.

    dataSource.read({status: $('#status').val()});

    Is the data parameter in the next example the same thing? 
    var dataSource = new kendo.data.DataSource({
          transport: {
                read: {
                      url: "http://example.com/test.php",
                      dataType: "json",
                 }
           },
          data: {
                status: $('#status').val()
          }...
    });
  9. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 22 Sep 2011 Link to this post

    @Pasi- Yes, those two techniques are functionally equivalent. Both will append the values as named parameters to the querystring when the data source fires a request to the remote service.

    Thanks for highlighting the alternate syntax option!

    -Todd
  10. Florian
    Florian avatar
    1 posts
    Member since:
    Apr 2012

    Posted 08 May 2012 Link to this post

    Hello guys,

    I'm trying to get the data via Coldfusion query I was wondering if someone could help me out with this?
    Hope I'd get a reponse, thx in advance, Flo

  11. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 09 May 2012 Link to this post

    Hello Flo-

    Thanks for using Kendo UI! It sounds like you're asking a new question. For future reference, in general it's best to start new forum threads for new questions so it's easier for others to find related answers. We're always happy to help, though, so let me try to provide some direct assistance.

    Whether you're using ColdFusion, PHP, Java, .NET, or any other server-side platform, the process for getting data to Kendo UI is mostly the same. You need to expose a web service endpoint that can serve-up data to your page with Kendo UI widgets. The web service can return JSON or XML data, though JSON is the more popular and common format.

    I'm not a ColdFusion expert, so I can't provide a direct code sample, but this site has a basic example of a ColdFusion web service that returns JSON: http://www.bennadel.com/blog/764-Learning-ColdFusion-8-Javascript-Object-Notation-JSON-Part-III-AJAX-Demo.htm

    Hopefully it gives you an idea of where your query fits-in to the picture. Once your query is returning JSON data, you can bind a Kendo UI DataSource directly to the endpoint (let's say it's http://yoursite.com/services/yourQueryServce.cfd?method=getData).

    Good luck on your project!
    -Todd

  12. Vesselin Obreshkov
    Vesselin Obreshkov avatar
    81 posts
    Member since:
    Jan 2010

    Posted 09 May 2012 Link to this post

    @Florian I haven't used ColdFusion in years, but from what I remember, when it serializes objects into JSON, it makes all field names UPPERCASE so a component like this:

    <cfcomponent>
      <cfproperty type="numeric" name="ProductID" />
      <cfproperty type="string" name="ProductName" />
      <cfproperty type="date" name="ExpirationDate" />
    </cfcomponent>

    will serialize with properties PRODUCTID, PRODUCTNAME, etc instead of ProductID, ProductName, etc. ColdFusion isn't case-sensitive but JavaScript (and in turn Kendo UI is). You can probably use a custom Java serializer to get proper serialization out of your ColdFusion apps  

    Look at this StackOverflow thread for some more pointers and sample code:
    http://stackoverflow.com/questions/2556476/ajax-coldfusion-cfc-json-hello-world

    Look at this blog post about a (hacky) way to get your objects serialized with their proper case:
    http://www.bennadel.com/blog/2162-Maintaining-Key-Case-During-JSON-Serialization-In-ColdFusion.htm 

    Probably your best bet would be to find some third party component/cfc (possibly written in Java that works with Jrun) that will give your proper JSON serialization. From what I remember, ColdFusion's built-in one sucks really, really bad.
  13. PRAVEEN KUMAR
    PRAVEEN KUMAR avatar
    1 posts
    Member since:
    Oct 2013

    Posted 07 Nov 2013 Link to this post

    Hi,, I did mobile web app in html5/javascript and i should connect for mysql database,, so i need to interact to jsp?
Back to Top
Kendo UI is VS 2017 Ready