Share on Google+Share on Google+

Nikhilkumar
Filtering
1 Answer(s)      6 years ago
Posted in : Java Beginners

I want my result from data base coming after executint select query fitered by some key words so plase give me the suggestion

Ads

View Answers

April 6, 2011 at 4:04 PM


import java.sql.*;
class  Retrieve{
public static void main(String[] args){
    try{
        int id=2;
           Class.forName("com.mysql.jdbc.Driver");
           Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root");
           Statement st=con.createStatement();
           ResultSet rs=st.executeQuery("select * from employee where id="+id+"");
           if(rs.next()){
              System.out.println("Name: "+rs.getString("name"));
              System.out.println("Address: "+rs.getString("address"));
              System.out.println("Contact No: "+rs.getInt("contactNo"));
              System.out.println("Email: "+rs.getString("email"));
           }
    }
    catch(Exception e){
    System.out.println(e);
    }

    }
}









Related Tutorials/Questions & Answers:
Traversing through filtering
Traversing through filtering       Traversing through filtering Using jQuery, you can... filtering. Miscellaneous Traversing Tree traversal. Traversing through
Advertisements
Dojo Filtering Select
Dojo Filtering Select         In this section, you will learn about the dojo filtering... to user to enter your text in the  filteringselect. Try Online: Filtering
sorting and filtering the displayed table data using jsp and xml
sorting and filtering the displayed table data using jsp and xml  I have created a xml file and a jsp file, which uses DOM parser to display the content of xml file in web page. Now I would like to sort and filter those data
Text Editor Extensions
Text Editor Extensions       ETEE is an Eclipse plug-in which extends the Eclipse text editors with some extra capabilities for filtering the text using command line
Problem With Combo Box Editable Property
Problem With Combo Box Editable Property  Hi I am new To Flex i had set Combo Box Editable Property as true. But I didn't get the property filtering in the combo box like when you enter text "S" in the combo box then the names
Java file filter
files, this is said to be filtering the files. The interface  FilenameFilter provides the logic of filtering. It will display a list of files with some
Velocity Web Edit
Outline With XML Node Filtering and Intuitive Images * Smart Indenting
File download security.
; In this script, filter_var() is used for filtering the file and valid
Setting a Filter on a Logger Handler in Java
the filtering facility that means when you set a filter on a logger object, the filter... creates a logger object that assists for filtering the data and it has three classes... and NumFilter class provides the facility for filtering data that implements
for-each loop in java
. for-each loop is not used for filtering. Example :  A program using
Miscellaneous Traversing
() This method ends the most recent filtering operation in the current chain
dhtmlxCombo - Ajax Autocomplete Combobox
. Filtering mode 6. Autocomplete mode 7. Editable mode   Four modes:  
Security Measure of Website
the security aspect by error checking through forms, filtering output
Data Provider Controls in Flex
functionality of data accessing, sorting, filtering and other collection functionalities
ClearBI
will be able to work with report (sorting, filtering, grouping, export to Microsoft
Introduction to Filter I/O Streams
. These methods performs some sort of filtering operations on the data and cannot.... FilterIntputStream and FilterOutputStream do not perform any filtering
Artifactory Maven, Artifactory 1.2.5, Maven 2 Enterprise Repository Released
supports remote Maven1 repositories proxying. * Backup Cleanup and Filtering - Automatic cleanup of old backups according to a retention period, plus filtering
Not able to filter rows of jtable with textfield in netbeans
not working means it is not filtering data and even i am not getting any exception
Not able to filter rows of jtable with textfield in netbeans
not working means it is not filtering data and even i am not getting any exception
Sitemap Linux Tutorial
Color Picker | Dojo drag and drop | Dojo Editor | Dojo Filtering
Email - Electronic mail
hosting companies will provide you round the clock support, spam filtering
Mysql Date Filter
rows in set (0.00 sec) Query for filtering the record by date:- The given
Jaret Table
excel integrated filtering (autofilter-style, customizable) and sorting
ESftp
excel integrated filtering (autofilter-style, customizable) and sorting
Open Source JMS
* Persistence using JDBC * Local transactions * Message filtering using SQL92-like
doubt in connecting mysql in flex - XML
want to show and on which column enable filtering; Click on Finish and thats all
doubt in connecting to mysql in flex - XML
you want to show and on which column enable filtering; Click on Finish and thats
PHP Filter
, and filtering easier which are the essential part of web application development... Sanitization: Similarly there is another type of filtering is offered by PHP, called
VoIP Routers
content filtering. Versions are also available with an ISDN interface and a built... Vigor2800VG includes features such as VLAN, QoS, Content filtering, VPN support for up
IsTra Issue Tracker
enhanced with user-defined filtering. For more information see complete list
Tutorials   
Java Spring Hibernate Struts Training What does core Java include? java What are some way to learn Java quickly? Is it required to learn Java before learning Java Script? Is it necessary to learn java script before learning PHP? Are HTML5 and Java Script boosts Java career? Is Java object oriented? Fingerprint application with Java Uninstall Oracle Virtual Box JSON to HashMap Free Java online Training I want example of Control Statement in Java ANSI Color Codes with Python Create a Program that Calculates Input What is difference between JDK,JRE and JVM? How to see ubuntu version on server? How to get Page Source in Selenium (WebDriver) using Java? The path to the driver executable must be set by the webdriver.gecko.driver system property parse data from a link in java Java Program Qns using BlueJ How to fix HAX Kernel Module Is Not Installed error? Installing Audacity Looking for code Logic to check track changes & Coments in MSWord, MSWordx, MSExcel, MSExcelx is ON/OFF Installing JDK on Mac SAX Parser exception ERROR 601 (42P00): Syntax error. Encountered Thread java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory How to install Ubuntu 16.04 LTS? HttpServletRequest cannot be resolved to a type in eclipse - Solved Unhandled event loop exception GC overhead limit exceeded Spring Data jpa with apache phoenix Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF o.a.h.h.z.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum= com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager not found How to download and install Java 8 on Windows? How to uninstall JDK 7? How to install gtk-doc-tools package in Ubuntu? How to install Oracle JDK 8 on Ubuntu? ejabberd_ctl.beam not found - Solved How to convert date to UTC format in Java? How to install autoconf, automake and libtool in Ubuntu 15.10? How to convert current date to mm dd yyyy format in Java? How to convert current date to dd mm yyyy format in Java? How to stop window closing in "internalFrameClosing" event. How to find list of all index in Neo4j? neo4j-server.properties file location SASLError using PLAIN: not-authorized how to convert war file into .exe file using java code

Ads

 
Advertisement null

Ads