This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Hi Gurus, I wanna ask is there any means by which we can connect to database without making a DSN... actuallly i am making a application in which we connect to database, and when that application is to be installed on client, i want that client shouldnt make any DSN. so is it possible.. how can we do it!!! thanks in advance Harry
Kareem Gad
Ranch Hand
Joined: Aug 06, 2001
Posts: 89
posted
0
Harry, Ok this is why they have this FORUM called JDBC. Now you didn't mention what database is this application running on. Let's say its ORACLE8i then the JDBC drivers that come with it are already installed with your ORACLE8i installation Assuming that you are using Java to develop your application (because this is a java interest site), your code where you connect to the database the connection string will look something like this :
Ok now to explain this . The String URL is called the connection string and it differs from one database to another because it is made up of four main parts. [list]The part before the @ sign tells which type of JDBC driver you're using because i wrote this code for thin clients in mind this is why it is you can find out all the different JDBC kinds by reading on oracle.com for example. [/list]
the part saying 127.0.0.1 that is where the host where the Oracle server was installed. you can have it any host name ofcourse.
the part with 1521 this is the default port for the oracle server.
the part with LOCAL , that was my Oracle service name , or in other words the SID ( Global Database Name also ) so if you have it any other name here is where to put it.
Hope this helps you out if u need anymore help on that please don't hesitate to contact me directly.
------------------ KaReEm
<b><i>KaReEm</i><br /><ul type="square"><li>SCJP-Free Range Web Developer <br /></ul></b>