Results 1 to 6 of 6

Thread: Connection and Statement objects in database connectivity

  1. #1
    Join Date
    Dec 2010
    Posts
    38

    Connection and Statement objects in database connectivity

    I have got a desktop computer, I am developing an application on Java , my project is on a navigation system , I have implemented a map which I had downloaded it from the google, I have taken a map of a particular area and the application which I am going to develop an application on this using the Netbeans application , but How ever I am not aware about the connectivity in the data base I am not exactly aware about the JDBC connectivity in which I am quite usnure about the Connection and the Statement objects in the database.

  2. #2
    Join Date
    May 2009
    Posts
    527

    Re: Connection and Statement objects in database connectivity

    Assume that you have a collection of records in an Access database that you wish to view through a front-end application such which has a GUI . You can plan a user interface by using a lots of programming languages such as Visual Basic, you can also make use of Visual C++, but as you said you are using Java, however , I appreciate your opinion because it renders a more reliable approach in designing these interfaces using the the javax.swing package. This package includes details about the Connection and statement objects in detail

  3. #3
    Join Date
    May 2009
    Posts
    529

    Re: Connection and Statement objects in database connectivity

    A far as furthermore, Java renders the Java Database Connectivity (JDBC) interface , with which you will be able to establish the connection with your application to any database created either with the help of Microsoft Access or it can also be able to create SQL Server. There are a basic steps , I suppose there are 7 steps to establish a connection and creating the separate Connection statement and Statement object.

  4. #4
    Join Date
    Apr 2009
    Posts
    488

    Re: Connection and Statement objects in database connectivity

    Before you create an Connection object you will have to load the suitable driver. You can make the use of one driver from the obtainable four. Nevertheless, the JDBC-ODBC driver is the most recommended among the programmers and developers. There is a code that you will have to follow if you want to load the drivers that are fundamentally required to load a JDBC driver. Please follow the given code.


    Code:
    Class.ForName("sun.jdbc.odbc.JdbcOdbcDriver");

  5. #5
    Join Date
    May 2009
    Posts
    539

    Re: Connection and Statement objects in database connectivity

    The getConnection() method of the Driver Manager class is invoked to get the Connection object. The syntax of the of instantiating a connection class is :

    Code:
    Connection c = DriverManager.getConnection("jdbc:odbc:<name of the DSN >");
    Here, make a note of that getConnection() , it is a static method, implying that it should be used along with the class related with the method. You have to provide the Data Source Name as an argument in the paranthesis of this method.

  6. #6
    Join Date
    May 2009
    Posts
    511

    Re: Connection and Statement objects in database connectivity

    After a connection to a specific database is established, that Connection object can be utilized to send SQL statements. The Java JDBC's Statement instances are JDBC's mode of running SQL statements to the database. A Statement instance is utilized to send SQL statements to a database.There are three major types of Statement objects: the parent class Statement, and like that there are two more statements thePreparedStatement, and there is also the CallableStatement. These objects are instantiated with the help of Connection object in the JDBC data base connectivity .



    Code:
        Statement st = DBConnection.createStatement();
    //This code will create  an SQL Statement object

Similar Threads

  1. insert into select statement for database
    By Aidan 12 in forum Software Development
    Replies: 5
    Last Post: 09-03-2010, 10:08 PM
  2. Case statement in oracle database
    By Kingfisher in forum Software Development
    Replies: 4
    Last Post: 04-03-2010, 10:21 PM
  3. Database Connectivity with ASP and ADO
    By Damien25 in forum Software Development
    Replies: 5
    Last Post: 28-01-2010, 10:51 PM
  4. Wireless Connection Cannot Hold it's Connectivity
    By Chintam in forum Networking & Security
    Replies: 5
    Last Post: 19-03-2009, 10:55 AM
  5. Mysql Database Connectivity Issue
    By joquim in forum Networking & Security
    Replies: 1
    Last Post: 26-12-2008, 06:57 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,670,314.25710 seconds with 17 queries