Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JDBC java.sql package interfaces

Have Programming Question? Ask it here!
 
 
 


Nagarjuna
java.sql package interfaces
2 Answer(s)      2 years and 2 months ago
Posted in : JDBC


In java.sql package majority are interfaces only, how instance will be created for these interfaces?


Advertisement
View Answers

January 16, 2013 at 5:34 PM


Hi, in jdbc we are using some jar files like for oracle ds we are using ojdbc14.jar. These jar files contain the classes which provides the implemtation to java.sql interfaces. For example the ojdbc14.jar file contain the class like OracleDatabaseMetaData class which provide the implemtation to java.sql.DatabaseMetaData interface. Hence

connection.getMetaData() contain the code to creat the object to OracleDatabaseMetaData.



May 25, 2012 at 2:26 PM


In java.sql package, there are several interfaces. These interfaces have been used in connection database with the java code.

import java.sql.*;

public class MysqlConnect{
  public static void main(String[] args) {
  System.out.println("MySQL Connect Example.");
  try {
  Class.forName("com.mysql.jdbc.Driver").newInstance();
  Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","root");
  System.out.println("Connected to the database");
  conn.close();
  System.out.println("Disconnected from database");
  } catch (Exception e) {
  e.printStackTrace();
  }
 }
}


Related Tutorials/Questions & Answers:
Introduction to java.sql package
Introduction to java.sql package       This package provides the APIs for accessing... especially relational databases. This java.sql package contains API
java.Sql - JDBC
java.Sql  Hai Friend, In my program i have sql statement like below: while(true) { sqlstmt="SELECT * FROM tablename"; rs=stmt.executeQuery(sqlstmt); while(rs.next()) { System.out.print("\n
Advertisements
interfaces
& interfaces.   An interface declaration introduces a new reference type whose members are classes, interfaces, constants and abstract methods... to directly implement one or more interfaces, meaning that any instance of the class
Package
Package  Create a Package named com.example.code. Write few classes, interface and abstract classes. Now create a class names PackageDemo that uses the classes of this package from other package
Package
Package  Create a Package named com.example.code. Write few classes, interface and abstract classes. Now create a class names PackageDemo that uses the classes of this package from other package
package:
package:  i hv created created a package and save it into D... in a package world. The we specify the keyword package with the name of the package. package world; public class HelloWorld { public static void main(String
package:
package:  i hv created created a package and save it into D... in a package world. The we specify the keyword package with the name of the package. package world; public class HelloWorld { public static void main(String
package
package  by what name we can save a java file that contain a package {i.e package p;} and several public classes {i.e public class abc} but not a main method
package
package  hello, What is a package?   hello, To group set of classes into a single unit is known as packaging. Packages provides wide namespace ability
package
can allow types in one package to have unrestricted access to one another, still restricting the access for the types outside the package
package
package  write a package for games which have two classes indoor... specifier and also use the finalize() method   We have created a package... class, we have imported this package and using a function display(), we have
package
package  Smith has created a package named ApplianceDetails that contains the Appliance class.Now he wants to create a class named NewAppliance that stores the details of the newly launched appliances.He uses the following syntax
package
package  Smith has created a package named ApplianceDetails that contains the Appliance class.Now he wants to create a class named NewAppliance that stores the details of the newly launched appliances.He uses the following syntax
EJB Interfaces
EJB Interfaces       Interface... interfaces. These are as follows 1)Remote interface:- Remote interface.... This is the interface where all of the business method go.javax.ejb.Remote package is used
Interfaces in flex
Interfaces in flex  Hi..... Please tell me about... What are - IStyleClient, IChildList, ILayoutManager, IToolTipManagerClient, IInvalidating, IValidatorListener, IFlexModule, IAutomationObject, IPropertyChangeNotifier
What are Callback interfaces?
What are Callback interfaces?  Hi, What are Callback interfaces? thanks
Marker interfaces in java
Marker interfaces in java  how marker interfaces work
Summary: Classes, Interfaces
Java: Summary: Classes, Interfaces Packages package package-name.... The default visibility is package visibility -- everyone in the this package can see it. parent-class This is the name of the parent
What is a package?
programming language, A package is group of related types of classes & interfaces...What is a package?  hi, What is a package? thanks   Hi, The Package is a mechanism for organizing the group of related files
EJB Interfaces
EJB Interfaces       Interface... interfaces. These are as follows 1)Remote interface:- Remote interface.... This is the interface where all of the business method go.javax.ejb.Remote package is used
Hibernate Callback interfaces
Hibernate Callback interfaces  What are Callback interfaces?   Callback interfaces allow the application to receive a notification when something interesting happens to an object?for example, when an object is loaded
Interfaces - Java Interview Questions
Interfaces  two interfaces having same method names and these two interfaces are implemented by a single class. so now i would like to generate different code of same methods of different interfaces. eg: ---- interface i1
Package categories in Java
interfaces and classes.  Package Name... Package categories in Java     ... hierarchy structure shown above. Note that, the package "java" also has
Collection Interfaces
Collection Interfaces     ... of several interfaces, and classes that implement those interfaces, contained within the java.util package. It provides tools for maintaining a data container
Interfaces - Java Interview Questions
Interfaces  two interfaces having same method names and these two interfaces are implemented by a single class. so now i would like to generate different code of same methods of different interfaces in single class? my query
java interfaces implementation
java interfaces implementation  hai I have defined one inter face like Maths taking methods like add(), sub(), mul()in interface I take different implementation classes for add() method and sub()and mul() when i trying
how to create interfaces in java
how to create interfaces in java  HI, Here is my code public interface validateInfo { public void validate(String empcode, String password); } class updateInfo implements validateInfo { public void update() { //code
interfaces - Java Beginners
interfaces  What is the mechanism going behind when an interface extends another interface?in case of classes when a sub class extends super class, super class constructor runs.what about interfaces?  Hi Friend
interfaces,exceptions,threads
interfaces,exceptions,threads  SIR,IAM JAVA BEGINER,I WANT KNOW THE COMPLETE CONEPTS OF INTERFACES,EXCEPTIONS,THREADS   Interface An interface is one which has abstract methods(not defined just declared)and static
Implementation code inside interfaces
Implementation code inside interfaces 2001-01-25 The Java Specialists' Newsletter [Issue 006] - Implementation code inside interfaces Author: Dr. Heinz... code than in interfaces, but I want to show you what is possible with inner
What are the Core interfaces are of Hibernate framework?
What are the Core interfaces are of Hibernate framework?  Hi, What are the Core interfaces are of Hibernate framework? Thanks
Hibernate: core interfaces of hibernate framework
Hibernate: core interfaces of hibernate framework  What are the core interfaces of hibernate framework   Most of hibernate based application code deals with following interfaces provided by the Hibernate Core
regarding java package - Java Beginners
regarding java package  can you provide tutorial for java.sql package please help  Hi friend, I am sending you a link. This link will help you. Please visit for more information. http://www.roseindia.net
package in java
package in java  when i run a package it give a error exception in thread "main" java.lang.NoClassDefFoundError what i do
package creation
package creation  program to create package having four different class in java
Package in Applet
Package in Applet  How do I use this technique for applets
Java package
Java package  Which package is always imported by default
Java package
Java package  What restrictions are placed on the location of a package statement within a source code file
Package in Servlet
Package in Servlet  How Create Package in Servlet ?   package packagename ; import java.io.*; import javax.servlet.*; import..."); PrintWriter out = response.getWriter(); out.println("Hello,Package Example
Java.io package
Java.io package  List the names of various classes supported by Java.io package to handle character stream.   Reader and Writer classes and their subclasses
problem with package
problem with package  Dear sir, i have created one java file with package com.net; and i compiled the program.it showing the .class file... message as can not access package class methods
userdefined package
userdefined package  package javap; class HelloWorld { public... declare a package then in command prompt i set the classpath.After that i compiled the class and run the package then i got the error C:\Users
Java Package
Java Package       In a computer terminology, package is a collection of the related files in the same directory. Package avoids naming conflicts between the files and make possible
Prepared Statement Example
. PreparedStatement is an interface declared in the java.sql package. PreparedStatement... the JDBC to work with database java.sql provides two interfaces for executing... of java.sql package for making connection with database and to insert value
Interfaces and Abstract Classes - Development process
Interfaces and Abstract Classes  What are the Scenarios where we use Interface and Abstract Classes?  Hi Friend, Interface: Java does... by using the interface. Interfaces are useful when you do not want classes
Jep's Rich User Interfaces blog
Jep's Rich User Interfaces blog       About AJAX Performance and some other things by Jep Castelein of Backbase Read full Description
What is a Java package and how is it used?
What is a Java package and how is it used?   HI, What is a Java package and how is it used? thanks,   Hi, In Java, package is a group of associated types of classes and interfaces that offers access protection
Getting list of Local Interfaces on a machine
Getting list of Local Interfaces on a machine... to find out the total no of list of local interfaces available on a machine. Here... a NetworkInterface class of java.net package which represented the local interface. After
Java package,Java Packages
various mathematical operations. java.sql This package... Java Package       Introduction to Java Package A Java package is a mechanism for organizing a group
Advertisements
 

 

 

DMCA.com