سؤال

in my JS file I need to do a search on the DB (select * from table where condition) and store the result in an array(multidimensional) do you have an idea how to do it ? thank you in advance

هل كانت مفيدة؟

المحلول

the best solution is to use the dataSource files using the <customSQL> tag , here is an example:

  <operationBindings>
      <operationBinding operationType="fetch">
         <customSQL>
         SELECT  Name, Adress, Phone, Age                       
        FROM tableName
            where Age >20

           </customSQL>
     </operationBinding>
  </operationBindings>  

نصائح أخرى

Don't write any code in your JavaScript related to Database.

In Smart GWT always access database using DataSource

You can use GWT JSNI to call Java method from JavaScript and vice-verse.

Find a sample code on Calling GWT Java function from JavaScript

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top