Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

connection data base java code

import java.sql.*;  
public class Bddconnection {
    public static void main(String[] args) {
        try{   
          //username:admin,password:admin,table:login,
            Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/bdd_test","admin","admin");  
            Statement stmt=con.createStatement();  
            ResultSet rs=stmt.executeQuery("select * from login");  
            while(rs.next())System.out.println(rs.getInt(1)+"  "+rs.getString(2));  
            con.close();  
        }catch(Exception e){System.out.println(e);}  
    }      
}
Comment

PREVIOUS NEXT
Code Example
Java :: java swing change label icon 
Java :: java icon to image 
Java :: java button with jpg image 
Java :: print outputstream to console java 
Java :: Mila Kunis 
Java :: im retarded 
Java :: why cant we have primitive types in generixs 
Java :: java dato numero big starkoverflow 
Java :: como pegar o valor de um campo de texto swing 
Sql :: sql developer search all packages for text 
Sql :: mysql show users 
Sql :: oracle nls_date_format 
Sql :: find column in all stored procedures sql server 
Sql :: identity_insert is set to off 
Sql :: drop stored procedure mysql 
Sql :: print oracle 
Sql :: oracle list columns schema 
Sql :: too many connections mysql 
Sql :: sql not start with vowel 
Sql :: how to change potgress password 
Sql :: sql server kill all connections 
Sql :: oracle rename table 
Sql :: Row Number is sql server 
Sql :: mysql select last 15 minutes 
Sql :: if date is today mysql 
Sql :: oracle create_program 
Sql :: mysql dump database command line linux 
Sql :: ora-01950 no privileges on tablespace 
Sql :: mysql count grouped rows 
Sql :: how to add auto increment primary key 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =