We can't create object of an Interface, in JDBC, Connection is an Interface where we can create an object.How?
151838
You can't create real objects for interfaces. You can have a reference for a object.\nConnection c;\n\nc = DriverManager.getConnection (url,"myLogin", "myPassword");\n\nThis is what happens - \nYour driver class (oracle/db2/sql/ whichever) makes a object which implements the interface Connection. The reference of this real object is returned by the getConnection method.\n\nThis is the real object which you access through the referecnce of the Connection interface. \n\nSo you cannot create an object of the Connection interface, only reference a real object through it.
641885
give more information. like which query causes the error ? what is the data being passed ? What is the Sequence of statement before the query is called? give the code?
1147478
Memory Handling.\nWhatever memory space you occupy by instantiating the objects should be released after your use.\nType Casting should also be taken care.
62878
If you are talkng about Java program, then the code will\nConnection c = new Connection();\ntry\n{\n c.connect("service");\n c.send("message");\n}\ncatch( Exception e)\n{\n //report exception\n}\nfinally\n{\n c.close();\n}
717695
Explain? I guess that's not very specific. anyways the following URL should help\n\nhttp://www.danhendricks.com/code/ASP/Database%20Connectivity%20in%20ASP/
656218
Object Oriented Databases\nObject oriented databases are also called Object Database Management Systems (ODBMS). Object databases store objects rather than data such as integers, strings or real numbers. Objects are used in object oriented languages such as Smalltalk, C++, Java, and others. Objects basically consist of the following: \n\nAttributes - Attributes are data which defines the characteristics of an object. This data may be simple such as integers, strings, and real numbers or it may be a reference to a complex object. \nMethods - Methods define the behavior of an object and are what was formally called procedures or functions. \nTherefore objects contain both executable code and data. There are other characteristics of objects such as whether methods or data can be accessed from outside the object. We don't consider this here, to keep the definition simple and to apply it to what an object database is. One other term worth mentioning is classes. Classes are used in object oriented programming to define the data and methods the object will contain. The class is like a template to the object. The class does not itself contain data or methods but defines the data and methods contained in the object. The class is used to create (instantiate) the object. Classes may be used in object databases to recreate parts of the object that may not actually be stored in the database. Methods may not be stored in the database and may be recreated by using a class. \n\nComparison to Relational Databases\nRelational databases store data in tables that are two dimensional. The tables have rows and columns. Relational database tables are "normalized" so data is not repeated more often than necessary. All table columns depend on a primary key (a unique value in the column) to identify the column. Once the specific column is identified, data from one or more rows associated with that column may be obtained or changed. \n\nTo put objects into relational databases, they must be described in terms of simple string, integer, or real number data. For instance in the case of an airplane. The wing may be placed in one table with rows and columns describing its dimensions and characteristics. The fusalage may be in another table, the propeller in another table, tires, and so on. \n\nBreaking complex information out into simple data takes time and is labor intensive. Code must be written to accomplish this task. \n\nObject Persistence\nWith traditional databases, data manipulated by the application is transient and data in the database is persisted (Stored on a permanent storage device). In object databases, the application can manipulate both transient and persisted data. \n\nWhen to Use Object Databases\nObject databases should be used when there is complex data and/or complex data relationships. This includes a many to many object relationship. Object databases should not be used when there would be few join tables and there are large volumes of simple transactional data. \n\nObject databases work well with: \n  \n\nCAS Applications (CASE-computer aided software engineering, CAD-computer aided design, CAM-computer aided manufacture) \nMultimedia Applications \nObject projects that change over time. \nCommerce \nObject Database Advantages over RDBMS\nObjects don't require assembly and disassembly saving coding time and execution time to assemble or disassemble objects. \nReduced paging \nEasier navigation \nBetter concurrency control - A hierarchy of objects may be locked. \nData model is based on the real world. \nWorks well for distributed architectures. \nLess code required when applications are object oriented. \nObject Database Disadvantages compared to RDBMS\nLower efficiency when data is simple and relationships are simple. \nRelational tables are simpler. \nLate binding may slow access speed. \nMore user tools exist for RDBMS. \nStandards for RDBMS are more stable. \nSupport for RDBMS is more certain and change is less
792978
all types in java are signed.  that's how it was designed.  i have found it to be a problem only very rarely.
75267
To do so you have to do type cast.\nchildObject= (child) parentObject;\nThough it is not recommended , and will through Exception if the object is not compitable with child object, but sometime you will need to cast type specially when reading an Object from file.
958854
here is a code to ge the available ResutSet types \n\nimport java.sql.Connection;\nimport java.sql.DatabaseMetaData;\nimport java.sql.DriverManager;\nimport java.sql.ResultSet;\nimport java.sql.Statement;\n\npublic class Main {\n  public static void main(String[] args) throws Exception {\n    Connection conn = getMySqlConnection();\n    System.out.println("Got Connection.");\n    Statement st = conn.createStatement();\n    st.executeUpdate("drop table survey;");\n    st.executeUpdate("create table survey (id int,name varchar(30));");\n    st.executeUpdate("insert into survey (id,name ) values (1,'nameValue')");\n\n    DatabaseMetaData meta = conn.getMetaData();\n\n    if (meta.supportsResultSetType(ResultSet.TYPE_FORWARD_ONLY)) {\n      System.out.println("type name=TYPE_FORWARD_ONLY");\n    }\n    if (meta.supportsResultSetType(ResultSet.TYPE_SCROLL_INSENSITIVE)) {\n      System.out.println("type name=TYPE_SCROLL_INSENSITIVE");\n    }\n    if (meta.supportsResultSetType(ResultSet.TYPE_SCROLL_SENSITIVE)) {\n      System.out.println("type name=TYPE_SCROLL_SENSITIVE");\n    }\n\n\n    st.close();\n    conn.close();\n  }\n\n  private static Connection getHSQLConnection() throws Exception {\n    Class.forName("org.hsqldb.jdbcDriver");\n    System.out.println("Driver Loaded.");\n    String url = "jdbc:hsqldb:data/tutorial";\n    return DriverManager.getConnection(url, "sa", "");\n  }\n\n  public static Connection getMySqlConnection() throws Exception {\n    String driver = "org.gjt.mm.mysql.Driver";\n    String url = "jdbc:mysql://localhost/demo2s";\n    String username = "oost";\n    String password = "oost";\n\n    Class.forName(driver);\n    Connection conn = DriverManager.getConnection(url, username, password);\n    return conn;\n  }\n\n  public static Connection getOracleConnection() throws Exception {\n    String driver = "oracle.jdbc.driver.OracleDriver";\n    String url = "jdbc:oracle:thin:@localhost:1521:caspian";\n    String username = "mp";\n    String password = "mp2";\n\n    Class.forName(driver); // load Oracle driver\n    Connection conn = DriverManager.getConnection(url, username, password);\n    return conn;\n  }\n}
149857
A collection in any language is a container that will hold other objects.  Examples of container classes in Java are List, Map, Set.  These are actually implemented as interfaces, they just define the basic methods that are expected for each of the different types of collections.  Concrete implementations for each of these interfaces would be HashSet, ArrayList, LinkedList, HashMap, TreeMap, TreeSet (there are others, but these are the most popular).\n\nThe simple answer to your question in regards to whether an interface and a class are the same is NO.  An interface is a definition of methods.  A class is an implemetation of those and probably other methods.  The syntax for this in Java would look like:\n\nclass X implements Y\n\nWhere X is the implemetation of the Y interface.  That is exactly how the collection classes are implemented in the JDK, the class declaration for ArrayList follows:\n\npublic class ArrayList<E> extends AbstractList<E>\n        implements List<E>, RandomAccess, Cloneable, java.io.Serializable\n\nNow, keep in mind that you CAN use an interface to access an instance of a class (an object).  For example:\n\nList myList = new ArrayList();\n\nList is an interface, ArrayList is a class.  Actually this is the intention of interfaces, separation of model and implementation. You could use a LinkedList in your code if you wrote your code this way just by changing the line that declares myList and no other code would have to be touched:\n\nList myList = new LinkedList();
993355
Hi, can you emphasize on the SQL Load Test Program. For instance what is your outcome to use such application.\n\nTo test if the sql connection is valid within an application, the drivers JDBC/ODBC/ADO which are the main ones 99% people use them.. already deal if the database connection method failed. If it failed it will return false.\n\nSo look into your api for the sql application your doing and see what the connect method returns.\n\nSorry if i answered your question differently, please clarify things :)
20248
Yes you can, JDBC is only thru java thou...\n\nWithin Java using the JDBC drivers, you can access any datasource.
536894
Make an ODBC and then use the JDBC-ODBC Bridge to connect to Access and issue SQL Statements to insert records in your DB!
52791
C) ABC, somthing1, something2 must be interface for the expression to be legal.\n\nThough java doesn't supports multiple inheritence for class, an interface can extend as many interface as needed. You can try compiling. But there is also a reason behind it.\nJava does not supports multiple inheritence because in diamond inheritence ( B and C extends A and D extends both B and C) it can cause ambiguity( as two copies of members of A would present in D).\nThis is not so for interface as there can't be ambiguity as all refer to same copy. So Java supports multiple inheritence for Inetrface
120766
In oracle, you can use Java to create the stored procedure.  But Java, as such, doesn't have any stored procedure concept in it.\n\nYou can invoke a stored procedure in a RDBMS thru Java.  How, here is the answer. http://www.onjava.com/pub/a/onjava/2003/08/13/stored_procedures.html\n\n\nHow to create stored procedure in Oracle using Java?\nhttp://www.developer.com/db/article.php/3337411
932102
You...cannot. Either declare it as a static variable, or create an instance of the object it is in.
70491
Connection Pool \n\nThe JDCConnectionPool.java class makes connections available to calling program in its getConnection method. This method searches for an available connection in the connection pool. If no connection is available from the pool, a new connection is created. If a connection is available from the pool, the getConnection method leases the connection and returns it to the calling program. \n\npublic synchronized Connection getConnection() \nthrows SQLException {\n\n  JDCConnection c;\n  for(int i = 0; i < connections.size(); i++) {\n     c = (JDCConnection)connections.elementAt(i);\n     if (c.lease()) {\n        return c;\n     }\n  }\n\n  Connection conn = DriverManager.getConnection(\nurl, user, password);\n  c = new JDCConnection(conn, this);\n  c.lease();\n  connections.addElement(c);\n  return c;\n}\n \n\n\nThe JDCConnection.java class represents a JDBC connection in the connection pool, and is essentially a wrapper around a real JDBC connection. The JDCConnection object maintains a state flag to indicate if the connection is in use and the time the connection was taken from the pool. This time is used by the ConnectionReaper.java class to identify hanging connections.