Searching database

I have a table that has bug(description,subject or something). i want to search it by keyword.
for example, a user enters "compatibility with Internet Explorer".
i want to find "compatibility" word and "Internet Explorer" from the table. then should i make a string array
like
String[] keywords = {"compatibility", "Internet Explorer"};
and search like this?
List result = new ArrayList();
for( int i = 0; i < keywords.length; i++ )
String sql = "select * from table where %description% = keywords;
String searchResult = search(sql);
result.add(searchResut);
i am kind of stuck in making an array with user's input and searching by keyword... please help...
Thanks in advance...

This is a SQL question and maybe you should look into SQL tutorials for this since the key to solvng your problem is to make a valid SQL statement that represents your query.
The following SQL Query would return all rows that had the two keywords in the record 'description':
List result = new ArrayList();
if(keywords.length == 0) {
    throw new Exception("You must supply at least one keyword.");
else {
  String SQL = "SELECT * FROM table WHERE";
  for( int i = 0; i < keywords.length; i++ )  {
    if(i > 0) sql = sql + " OR";
    sql = sql + " description LIKE '"+keywords[0]+"'";
  String searchResult = search(sql); // I guess this performs a query :)
}

Similar Messages

  • Bug in the  search database of Javahelp

    Hi all,
    in this project I am importing from Framemaker and generating Javahelp output. The Javahelp does not work when there are non-ASCII characters in the topic filenames (such as accents or umlauts). Therefore I have to adjust the file naming in the imort settings to "<$filename_no_ext>-<n>". As a result I get topics with numbered filenames and all seems well.
    BUT with this setting the Javahelp displays the totally cryptic filenames of the topics as search results. Why does Robohelp not create a search database with the topic titles as search results?
    How do you handle Javahelp projects for non-english languages?
    Robert

    I have the same problem. I have a registered domain name which contains a "-" character. Its not possible to set it correctly because it is filtered out. A "-" is an valid part of a domain name so why it is filtered? I have tried to edit the bootpd.plist file, but its getting overidden after a few seconds.
    Could anyone help? A fix is absolutely necessary, without it I have to change the search domain on all client computers.

  • LOve Firefox but it's annoying that if I'm using a search engine (I use lots of subscription legal search databases), when I press the back button all the data I entered in the search boxes has disappeared. I'm sure Firefox didn't use to do that?

    Love Firefox but it's annoying that if I'm using a search engine (I use lots of subscription legal search databases), when I press the back button all the data I entered in the search boxes has disappeared. I'm sure Firefox didn't use to do that?

    Please do the following.<br><br>
    #Click the Firefox button, go to '''Options '''| '''Options''' | '''Privacy'''.<br><br>
    #In the dropdown menu at the top, change it to "'''Use custom settings for history'''"<br><br>
    #Checkmark the option: "'''Remember Search and Form history'''".<br><br>
    #Remove the checkmark from: "'''Clear history when Firefox closes'''".

  • How to search Database in JSP using LIKE

    hi can anyone tell me is there any other syntax for Query when we use LIKE to search database in which suppose
    String para = request.getParameter("name");
    Select name,surname From user where name LIKE '"+para+"';

    hi,
    which database are you using, some require you to put % sign with like
    e.g. select xyz from table abc where xyz like '%"+para+"%'

  • How do I index a new search database?

    I want to create a robot and run it against a URL and build an index( RDs), on my own defined search database. But only the default database get's indexed.
    How do I point my Robot to my new defined search database?
    Also I would like to be able to index a file system (a directory that contains only XML files). I have already created my filter specifying to allow any file with the extension .xml. but it doesn't seem to work? What do I need to do?
    Thanks.

    I think I understand what you are trying to do. I assume that you have created a new database from the admin console, and now you want to use the robot to index that database?
    If that's the case you should be able to specify the database to populate, when defining a site for the robot to crawl. The option to set the database to populate is right at the bottom of the screen of the site editor, after the filter definitions and the advanced option.
    Hope this helps.

  • JavaHelp : Search Database

    how to create the search database ?
    from what i had read, use the jhindexer command
    let say my program is in the folder
    F:/programming/java_pj/OOP
    and i have to run the command in dos at F:/programming/java_pj/OOP/help
    with the command
    jhindexer OOP*
    is this correct ?
    and i got this when i run it
    'jhindexer' is not recognized as an internal or external command, operable program or batch file.anyone can help me with this ?

    no one using JavaHelp here ?

  • Search database not categorized

    Hi
    I have configured the portal search facility to crawl my portal
    content.
    I have also configured a number of classifications.
    The robot works fine and populates the search database. I can
    search the database using the basic and advanced search on the portal desktop.
    However no information is linked to the configured classifications.
    Do I need to update something in the default robot configuration for this to work?
    Cheers
    Hannes

    I hope this answers your question.
    It doesn't answer my question but it still helps me determine your level of knowledge.
    For your search results page code the php is processing data that's sent via URL parameter. That's what the snippet you provided is saying:
    $colname_Recordset1 = "-1";
    if (isset($_GET['form1'])) {
      $colname_Recordset1 = $_GET['form1'];
    That says that if a URL parameter for form1 is set then set the value of the parameter to the variable for processing in your query. That's why I asked where your search form code is. You explained your search from briefly, but didn't provide a code. For search page you need a form to send the URL parameter 'form1' to the search results page. Use something like this on search page for your form:
    <form action="results_page.php" method="GET">
    <input type="text" name="form1">
    <input type="submit" value="Search">
    The action of the form should point to your search results page to process the data into a query and display the results. GET method of a form will send the "name" data of each form element as a URL parameter. So if you searched for entered text on your search form then when you click submit the URL will look like: www.your-domain.com/result_page.php?form1=entered%20text
    Your script will take data form URL parameter and process the data in your query. That should get you going in the right direction.

  • WSS Search database

    I am using Sharepoint WSS. I was testing a restore on the same server and for some
    reason it has changed the search database to the test restore search database(WSS_Search_Tester). But it needs to be WSS_Search_Production, I have gone to the 'Services on Search Service setting' configure page, but the database name is grey.

    Please stop the Windows SharePoint Services Search
     - Open the SharePoint Central Administration
     - Select the Operations tab and then select Services on Server from under the Topology and Services
     - select Windows SharePoint Services Search and click on 'Stop'
     - You will then receive a message  that the index files will be deleted. Press OK to continue
    Search service will stop, now you can reconfigure search service to update with new DB name
     - Click on hyperlink 'Windows SharePoint Services Search'
     - fill all the required details and Press the OK button to create the Search database and start the SharePoint Search Service
     - Start Full Crawl ro reindex the content
    Thanks, ShankarSingh

  • Duplicate Search Databases in SharePoint Foundation 2013 Farm

    I seem to have 2 seperate issues with Search within my SharePoint Foundation 2013 Farm. This is a new Farm, so I can remove the search service application and re-create if this is a way that can clear the 2 issues I am experiencing.
    Issue 1:
    For some reason I have 2 instances of the following search related DB's:
    SearchAdminDatabase
    SearchAnalyticsReportingDatabase
    SearchGathererDatabase
    SearchLinksDatabase
    1 instance of each of the databases all report database status of "No Action Required" and the other instance of all the DB's report a database status of "Not Responding".
    Issue 2:
    My search service application seems to be working fine as I am able to crawl content and retrieve results, however the DB's associted with this search service application are reported with the following warning within the SharePoint Health Analyzer. I have
    been unable to run the Upgrade-SPContentDatabase command against these databases as I get a message saying that the content database could not be found:
    Title
    Databases running in compatibility range, upgrade recommended.
    Severity
    2 - Warning
    Category
    Configuration
    Explanation
    The following databases have versions that are older than the current SharePoint software, but are within the backwards compatible range:
    Search_Service_Application_AnalyticsReportingStoreDB_a3c64b2f3b9b4a5d83383ec0b1ecfcf4,
    Search_Service_Application_CrawlStoreDB_ffb8d716450242cc849a7f44f521bfc9,
    Search_Service_Application_DB_0fe433c02db6435db85285e9fd83863e,
    Search_Service_Application_LinksStoreDB_75efb2f689cf49f19c98a5a8155e47b7.
    Remedy
    To achieve optimal results from these databases, use Upgrade-SPContentDatabase to upgrade Content databases, or psconfig.exe to upgrade other databases.  For more information about this rule, see "http://go.microsoft.com/fwlink/?LinkID=142697".
    Kevin Evans

    At time people create search service application and delete it. SA is deleted but database were not deleted for some reason. so these might be those stale database. You can delete them if you want
    http://blogs.technet.com/b/tothesharepoint/archive/2011/12/19/find-active-databases-used-by-sharepoint-server-2010.aspx
    If you want a report of all of your SharePoint databases that includes the GUIDs and related property values, use the SharePoint 2010 Management Shell.
    There are several Windows PowerShell cmdlets you can use to find all of the SharePoint databases and then print this report to a text file. The quickest and perhaps easiest cmdlet is “Get-SPDatabase”. Run this cmdlet in the SharePoint
    2010 Management Shell to list all of the SharePoint Server databases with properties for each one. From this potentially large list you can then obtain specific information such as the database ID by using additional syntax in your cmdlet. Similarly, also
    in the SharePoint 2010 Management Shell, run “Get-SPDatabase | Sort-Object
    disksizerequired -desc | Format-Table Name” and you will get a simple list of the names for each database. You can then print this list to a text file by adding, “| out-file c:\db.txt” to the end of the command. 
    For detailed information, see
    Windows PowerShell for SharePoint Server 2010,
    Database cmdlets, 
    Get-SPDatabase, and
    Get-SPContentDatabase.
    If this helped you resolve your issue, please mark it Answered

  • How to rename the search databases in sharepoint 2013

    Hi all,
    I have configure the search in sharepoint 2013 and 4 databases has been created in sqlserver.by default db are got created with GUID n sh i want change those DB names .
    could you pls help me how can i change the DB names.
    THanks
    Dhana
    sekhar

    Hi,
    Please check the below links,
    https://technet.microsoft.com/en-us/library/jj219654(v=office.15).aspx
    https://technet.microsoft.com/en-us/library/ff851878(v=office.15).aspx
    http://blogs.technet.com/b/meamcs/archive/2012/10/23/renaming-sharepoint-2010-search-service-database-name.aspx
    Don't forget to mark it as an Answer if it resolves your issue and Vote Me as helpful if it useful.
    Mahesh

  • Search database for a matching value

    An existing database saves the results from a test as col 1 "serial number" col 2 date etc.
    There is now a requirement to search on the serial number and display any results related to it (rows).
    I have the database toolset and have started by using the SQL vi to extract the serial number passing a recordset ref number. I am at the point where I now need to select the row for that ref number but was wondering if it would be better to just read in the database to an array and then do a search on the serial number col looking for matching text, obtain the row of the array where matches occur and then display those rows, or is this route really long winded and should stick with the SQL vi?
    Thanks
    Jack
    Labview Version 8.5
    Labview Version 8.6
    Labview Version 2013
    Solved!
    Go to Solution.

    Paul
    Thanks for reply and I will do as you suggest and go with the SQL vi. I have a few problems using this vi so far. The first is that to Search say the Status field for Pass or Fail I used the query:-
    select Status from TestDetails1 where Status="Pass"
    This instruction resulted in an error message. So I tried a different field Ambient where the temperature is logged:-
    select Ambient from TestDetails1 where Ambient=23      (ambient temperature at 23 deg C) 
    This command line worked fine and brought up all instances where 23 occurred.
     Also when I use the vi 'Fetch recordset data' I get just the values searched on not th erows to which they belong.
    Thanks
    John
    Labview Version 8.5
    Labview Version 8.6
    Labview Version 2013

  • Which is better:search JTables or search Database tables?

    greetings all
    i have UI With many jtables,every jtable reads data from it's own table in a MySQL database
    and i want to make a search mechanism in a specific column in all the tables
    and once item is found the row is highlighted.
    i made it with two ways:
    1-make for loop in each jtable and once item is found , current loop is exited and other loops are not entered
    2-make connection with the database
    and create several resultsets ,every resultset execute a select query on the desired item
    and if one of the Resultsets returns data means item is found then i highlight it in the equivalent jtable.
    i executed the two ways and felt no difference in the speed of finding item
    but i want to know what is the best way of them or in general,as better design or in case of large applications?
    thanks in advance

    first_knight, you have no bloody idea what you're doing.
    you're asking if it's better to search on the client or the server.
    this suggests to me that the entire contents of the database are brought down to the client. this is usually a bad idea except for very small data sets. in that case, it doesn't matter where you do it.
    if you have lots of data, it's best to let the database do it. first, it will actually have all the data. second, it's been optimized to do searches faster than any code you'll ever write.
    either way, judging from your questions here you'll never get either one to work.
    %

  • Error while renaming Search databases

    followed below steps to rename search dbs.
    http://blogs.technet.com/b/wbaer/archive/2013/12/18/how-to-rename-search-service-application-databases-on-the-same-server.aspx
    But getting error while pointing to new renamed DB. Please advice
    $SearchService | Set-SPEnterpriseSearchServiceApplication -
    DatabaseName SSA -DatabaseServer SPDEV
    Set-SPEnterpriseSearchServiceApplication : The remote procedure call failed.
    (Exception from HRESULT: 0x800706BE)
    At line:1 char:18
    + $SearchService | Set-SPEnterpriseSearchServiceApplication -DatabaseName SSA
    -Dat ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ~~~
        + CategoryInfo          : InvalidData: (Microsoft.Offic...viceApplication:
       SetSearchServiceApplication) [Set-SPEnterpriseSearchServiceApplication], C
      OMException
        + FullyQualifiedErrorId : Microsoft.Office.Server.Search.Cmdlet.SetSearchS
       erviceApplication

    did you stop the Search service Application before staring the process. 
    Are you on the SharePoint Server? try to Run the SharePoint powershell console as Administrator.
    Also make sure the account under which you are running powershell having the rights on the new Databases.
    try this one and see if you can get the searchservices application name:
    $SearchService = Get-SPEnterpriseSearchServiceApplication <SearchServiceApplicationName> 
    $SearchService
    here is the technet for the same process.
    http://technet.microsoft.com/en-us/library/jj219654(v=office.15).aspx
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • How to Search database  through JSP

    I ve created JSPs. How do i carry out search in my Oracle database? Can nebody help me with some code or some link where i can find some help.

    String clsDriver = "DriverName";
    Class.forName(clsDriver);
    String dbUrl = "jdbc:oracle:thin:@dbmachine:dbport:dbsid";
    String dbUser = "dbuser";
    String dbPass = "dbpass";
    java.sql.Connection con = java.sql.DriverManager.getConnection(dbUrl,dbUser,dbPass);
    java.sql.Statement stmt = con.createStatement();
    java.sql.ResultSet rs = stmt.executeQuery("select column from table where column2 like '%"+search_criteria+"%'");
    while(rs.next())
        out.println(rs.getString("column"));
    rs.close();
    stmt.close();
    con.close();Update bold, italic values by ur specific values.

  • Web interface to search database

    Currently I need to implement a web interface for search & enquiry of databases.
    The senario is there is a page to provide search criterion, the criterion may comes from column A from Table 1, column B from table 2 (all thse tables can be joined). After speicified these criterion, the search result can display fields from various columns of various table.
    Is there any framework does it?

    No. If there were a simple way, they wouldn't be able to charge money.
    There are free tools, but they aren't nearly as easy to integrate and use.
    See iReport / JasperReports.
    Works best with Ant and Eclipse.

  • Search database fields using single text field

    Kindly advise on how to develop a database search page such
    that there is
    single text field to enter serach string and the results are
    shown on the
    same page.
    ALso guide if there is any extension available for achieving
    the above.

    I understand what you say.
    What I am looking for is a wizard or an extension which
    creates the form, as
    well as writes the SQL string and also generates the results
    page
    (preferably on the sarch page itself).
    I am looking for a google like solution where the site
    homepage has one text
    field, and users can search for all the fields of a database
    to give results
    on the same page.
    Please help.
    "malcster2" <[email protected]> wrote in
    message
    news:gg9g8b$lf9$[email protected]..
    > the simplest way of doing it is to have an input box and
    a submit button
    > in a
    > form,
    >
    > when the submit button is pressed, the text in side the
    input box is
    > posted to
    > a variable.
    >
    > the variable is then inserted into a mysql select
    statement, and the
    > results
    > are then echoed to the screen.
    >
    > all of this using php.
    >
    >
    >
    >

Maybe you are looking for

  • ICal - recurring "server responded with an error" message

    After years of using iCal without problems, (except for some recent duplicate alarms), a recurring error message has suddenly started popping up. It says: "The server responded with an error. Access to account "***@me.com" is not permitted. The serve

  • Cannot install Dreamweaver CS3 on Vista

    I'm running a desktop PC with Windows Vista Premium. I had Dreamweaver 8 installed and want to upgrade to Dreamweaver CS3. So I uninstalled Dreamweaver 8 and ran the setup for CS3. After the setup extracted all he necessary setup files I saw a messag

  • TextArea in Table

    Hi! I am trying to include a textArea as one of the cells in a JTable. I tried doing this: public class MyCellRen extends JTextArea implements TableCellRenderer MyCellRen() super(); public Component getTableCellRendererComponent(JTable table, Object

  • Canadian living in Denmark, Skype to go number to ...

    Can a Canadian with a Canadian skype acccount who is leaving in Denmark for several months get a skype to go number so they can call from a Danish mobile number to a Canadian land line? This accound does have a subscription for North America unlimite

  • Import data external system in PCUI SAP CRM install base Object fact sheet

    I want to import data from third party system to Object fact sheet of install base. Please let me know the possible way to do so. Do I need to import data in BI and then to Object fact sheet?