Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

r there any other way to connect to database

 
megalag
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai All,
R there any other way to connect database other than JDBC. if yes, pl. reply
Thanks in advance.
 
KASI VISHWANATH
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if ur using java, u need dabase drivers that need to be compatible with java, which can be done using jdbc only.
------------------
I.K.VISHWANATH
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Java Ranch has a naming policy, described here and "megalag" is not a valid name. Please choose one which meets the requirements.
Thanks.
 
Gregg Dale
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is an .asp hybrid shortcut we have used on projects here where I work to pass data requests to a database and return disconnected recordsets.
Using java.net we open an .asp page as a document, passing stored procedure name and parameters as the querystring portion of the url (in a couple of cases we have passed simple sql), using ADO in the .asp to execute the query, and response.write'ing the result in a deliminited fashion easily parsible by the calling java class.
Its quick and easy for executing updates and returning disconnected recordsets, but won't, of course give you a static connection to the database.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are many other ways of connecting to databases, but they all need extra work, and all are specific to particular databases or database interfaces. For example, you could implement Oracle's SQL.NET protocol yourself, rather thna using Oracle's thin drivers, or write code to parse the data structures in an Access MDB file. You would need to deal with threading issues and data integrity yourself, but it could theoretically be done.
When JDBC is so easily available, powerful, and implemented for such a wide range of databases there seems little reason other than personal interest to do any of this, though. If you are interested in this sort of thing, there is a book "Java Database Programming" by Brian Jepson, published by Wiley, which describes in detail the implementation of an SQL database which uses plain text files for data storage, and includes all the source code.
 
Ray Hunter
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
However there are some draw backs to JDBC. Some might be speed. When you are connecting to a database the first thing to do is find out how many hit the page will have and about how many queries will be expected.
Sometimes java is better to use on a site that gets more hits then another.
Sometimes you can use other languages that will be faster. It is all relative to the site.
Many times I use PHP to interface with an Oracle database or Postgres database.
On the sites that use PHP, jdbc was slower.
RMI would be another option to look into.
Hope that answers some questions.

Ray
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic