- 
	
	
		
			
			
				Junior Member
			
			
			
			
				
					
						
					
				
			
			 
			
				
				
				
				
				
					    
				
			
		 
		
			
				
				
				
					JDBC driver and datasource
				
				
						
							
							
						
						
				
					
						
							JDBC-Implementation of Connection,Resultset,Statement 
In JDBC We use Connection,Resultset,Statement..etc.
All these are interfaces, but we are using it.. 
My Question is: 
1.Where is the implementation of these interfaces?
2. We will load the JDBC driver in the first step.. Instead can we put the driver class in class path? Why loading class using Class.forName()
3.What is the difference between using JDBC driver and datasource?
Thanks in advance.
						
					 
					
				 
			 
			
			
		 
	 
		
	
 
                                             
- 
	
	
		
			
			
				Junior Member
			
			
			
			
				
					
						
					
				
			
			 
			
				
				
				
				
				
					    
				
			
		 
		
			
				
				
				
					Re: JDBC driver and datasource
				
				
						
						
				
					
						
							JDBC driver is used to communicate the data to and fro. DataSource is an entry point in the database where we will enter into database and schemas.
						
					 
					
				 
			 
			
			
		 
	 
		
	
 
                                             
- 
	
	
		
			
			
				Junior Member
			
			
			
			
				
					
						
					
				
			
			 
			
				
				
				
				
				
					    
				
			
		 
		
			
				
				
				
					Re: JDBC driver and datasource
				
				
						
						
							
						
				
					
						
							Java DataBase Connectivity API provides only interfaces so that using JDBC in your application will be independent of different types of Databases like Oracle, MySQL etc. And the database vendor like Oracle  etc. provides the implementation of these interfaces specific to their product.
When you are running ur application you will provide some .jar or .zip files namely ojdbc14.jar etc. in your classpath. These jar/zip s are nothing but the classes(Vendor specific) which provides the implementation JDBC API. 
If u can observe, when u want to create a statement object, u will call createStatement() method on Connection object. These methods are factory methods which contains the implementation of Statement interface.
						
					 
					
				 
			 
			
			
		 
	 
		
	
 
                                             
		
		
		
	
 
	
	
	
	
	
	
	
	
	
	
	
	
		
		
			
				
				Posting Permissions
			
			
				
	
		- You may not post new threads
 
		- You may not post replies
 
		- You may not post attachments
 
		- You may not edit your posts
 
		-  
 
	
	
	Forum Rules