![]() |
Jdbc
Heeey guys!
it's the first time for me to post a thread here.. I have a big dilemma and I need your help.. I have a project at uni about making a JDBC ..here it is : Introduction JDBC (Java Database Connectivity) is a standard SQL database access interface, which provides uniform access to a wide range of relational databases. It also provides a common base on which higher-level tools and interfaces can be built. Basically, JDBC performs the following operations: • Establish a connection with a database or access any tabular data source. • Send SQL statements. • Process the results. JDBC defines a set of main interfaces to handle the previous three steps java.sql.Driver java.sql.Connection java.sql.Statement java.sql.Resultset The Driver interface handle requests for database connections, the Connection interface provide means for accessing the specified database and querying it using standard SQL queries. Each SQL query need to be passed to the connection through an object implements Statement interface, the return value of the query will be stored in an object implements ResultSet interface. The following code snippet for a simple JDBC program. :
// Step 1 : Establish the conenctionProblem Statement It is required to implement and XML JDBC deriver that access and XML database and make some queries on it. First you will need to implement a simple Database Management System ,DBMS, that handles XML tables, it is let for you to specifies the structure of your XML tables. You will use SAX parser in parsing the tables data. Second, you will implement the JDBC four main interfaces; java.sql.Driver, java.sql.Connection, java.sql.Statement and java.sql.Resultset. You won't implement all methods of the previous interfaces, instead you will use adapter classes to handle the unneeded functions for our driver as the following. java.sql.Driver Will be implemented with all its methods. java.sql.Connection Implement the following methods; close(), commit(), createStatement(), isClosed(), isReadOnly(), setReadOnly(boolean readOnly). java.sql.Statement Implement the following methods; addBatch(String sql), clearBatch(), close(), executeBatch(), executeQuery(String sql), executeUpdate(String sql), getConnection(), getMaxRows(), getQueryTimeout(), getResultSet(), getUpdateCount(), setMaxRows(int max), setQueryTimeout(). java.sql.Resultset Implement the following methods; absolute(int row), afterLast(), beforeFirst(), cancelRowUpdates(), close(), deleteRow(), findColumn(String columnName), first(), getObject(int columnIndex), getObject(String columnName), getRow(), getStatement(), insertRow(), isAfterLast(), isBeforeFirst(), isFirst(), isLast(), last(), moveToCurrentRow(), moveToInsertRow(), next(), previous(), relative(int rows) , rowDeleted(), rowInserted(), rowUpdated(), updateObject(int columnIndex), updateObject(String columnName) The resultant JDBC of your implementation should be able to run code like given in the previous example and similar codes that execute SQL quires. Our proposed XML driver will support the following SQL statements: :
INSERT INTO table [ column [,column, …. ]]In your implementation you must have a general class for logging your different error, warnings and messages. It is recommended to use Log4J project for logging ------------------------------------------------------- now I need an example of an implementation of any of the functions coz I don't know where to start!!! please this is urgent thanks a lot Evronia |
Re: Jdbc
Do your own <snip> homework pal.
|
Re: Jdbc
A verbatim copy-and-paste of your homework. Your lack of effort literally makes me sick.
If you can't come up with a simple set of code and post a specific question, then perhaps you should re-evaluate things. Start here: google.com or your textbook. I'm not doing your homework for you unless I can have your diploma/degree, since afterall, I am the one who will be earning it. |
Re: Jdbc
http://www.w3schools.com/sql/default.asp
Best place to start is by learning the basics http://www.kitebird.com/articles/jdbc.html http://java.sun.com/docs/books/tutorial/ Sorry I like throwing links out there. BTW does it pay to do your homework? I would love to afford to go to college to "learn" this stuff also. Send me an e-mail to how much it pays and I'll tell you if it's worth anymore of my time. |
Re: Jdbc
If you give clearer specifications, I could guide you in the right direction. What is your "database" going to look like? If you could give a sample, that would help. I have never used an "xml database".
|
Re: Jdbc
Quote:
|
| All times are GMT -5. The time now is 3:32 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC