HOW TO RUN JDBC PRORAM ON JDK1.5.0

HOW TO RUN JDBC PRORAM ON JDK1.5.0

import java.sql.*; 
import java.util.*; 
class MyDbCode3*
 {
public static void main(String [] args) 
{ 
try `print("code sample");`
{ `print("code sample");`
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); 
}
 catch(ClassNotFoundException cnf)
 { 
System.out.println("Cannot load the Driver");
 System.exit(1); 
} 
Scanner kb=new Scanner(System.in);
 int id;
 System.out.println("Enter bookid:"); 
id=kb.nextInt();
 try 
{
 Connection conn=DriverManager.getConnection("jdbc:odbc:advdsn1","student","myself"); Statement st=conn.createStatement(); 
String qry="Update mybooks set price=price+1000 where bookid="+id; System.out.println(qry); int x=st.executeUpdate(qry); System.out.println("Rows effected="+x);
 conn.close();
 }
catch(SQLException sq) 
{ 
System.out.println("Sql Error:"+sq.getMessage());
 }
 }
 }
****for running this program i am using jdk1.5.0`*print("code sample");*`
I have created Dsn Successfully ,table also has been created successfully and when i compiled this program then it compiled successfully ,but when i run it ,it gives following error->
C:\Program Files\Java\jdk1.5.0\bin>java MyDbCode3 Enter bookid: 101 Sql Error:[Microsoft][ODBC Driver Manager] Data source name not found and no def ault driver specified
i want to know what is the problem? and how can i run it successfully? please give me a satisfieng answer ,bcz i am not satisfied by ur previous answer...
thank u ....****
View Answers
Post***
View Answers

March 28, 2011 at 5:23 PM

1)create database and table 2)write the java code 3)provide ODBC connection 4)execute your code...









Related Tutorials/Questions & Answers:
HOW TO RUN JDBC PRORAM ON JDK1.5.0
HOW TO RUN JDBC PRORAM ON JDK1.5.0  import java.sql.*; import... driver specified i want to know what is the problem? and how can i run... { Connection conn=DriverManager.getConnection("jdbc:odbc:advdsn1","student","myself
How Jdbc program can be run??
How Jdbc program can be run??  import java.sql.*; import java.util.... is the problem? and how can i run it successfully? please give me a satisfieng answer... { Connection conn=DriverManager.getConnection("jdbc:odbc:advdsn1","student","myself
Advertisements
how to run jdbc program in linux-ubuntu?
how to run jdbc program in linux-ubuntu?   how to run jdbc program in linux-ubuntu
how to run jdbc program in linux-ubuntu?
how to run jdbc program in linux-ubuntu?  how to run jdbc program in linux-ubuntu?   hi firstly download the jdk on your system using terminal or go to softwear management then download openjdk-6 or commandline
how to run jdbc in jsp program - JSP-Servlet
how to run jdbc in jsp program  i want to use sql server 2005 in jsp program to store data.i know how to run simple program but this program i tried my best i am not able to do so.please give me the answer of this as soon
jdbc run time error - JDBC
jdbc run time error  i m creating the table using thin driver it is showing the following run time error: Exception in thread "main...=DriverManager.getConnection("jdbc:opracle:thin:@ptpl:1521:oracle","scott","tiger
java run time error - JDBC
java run time error  when i m running for batch execution program in jdbc i m facing this kind of runtime error as Exception in thread "main...=DriverManager.getConnection("jdbc:oracle:thin:@ptpl:1521:oracle","scott","tiger
not able to run in gcj file - JDBC
not able to run in gcj file   We have a java program in Linux environment, which hits DB for some data and encode the same. We need to compile... to run the java program it says that Classes12.Jar?s oracle Driver missing. We
java run time error in loading the driver - JDBC
java run time error in loading the driver  when i mrunning...:jdbc.driver.OracleDriver the code was as follows: please suggest me how it can... JDBC driver's JAR file in your classpath and check it Thanks
how to run applet - Applet
how to run applet   Hi everybody i am using connecting jdbc in applet program. this is executed successfully with appletviewer command >... how can i execute in browser ? Thanks in advance thanks for seeing my
how to run rmi program
how to run rmi program  how to run rmi program
how to run this program?
how to run this program?  how to run java swing program   Java Swing program runs same as a simple java program. There is no difference... with javac and run with java command, same as a simple java program. Learn Swing
how to run - Java Beginners
how to run   how to run java program... brifely  Hi... to execute or run the program. For ex, If you have the following java program... file on the command prompt using: "javac HelloWorld.java". And then run it using
How to compile and run the JSP
How to compile and run the JSP  Hi Kindly tell me how to run and compile JSP small Program using Tomcat as webserver. I created small program HELLO JSP in HTML and compile the program but it is saying Class o r interface
how to run servlet
how to run servlet  Servlet run procedure for J2EE Software   Hi Friend, Please visit the following links:ADS_TO_REPLACE_1 http://www.roseindia.net/servlets/introductiontoconfigrationservlet.shtml http
how to run java program
how to run java program  i have jar file. in jar i have so many classes.in one of file i want modify .after modifying file i want replce in jar. please help me to how to generate class and how to replace
How to run? - Hibernate
How to run?  Hiiiiiiiiiiiii friend.. i am Magesh, doing MCA at Madurai in Tamilnadu. i know little bit about Jsp,Servlet.. But my friends are told hibernate is a new entry to Java. so plz try to tell how to use
how to run a applet from browser
how to run a applet from browser  hi, iam sending the code of an applet. it is working in cmd prompt,but not working from browser. <APPLET CODE... Random(); try { String connectionURL = "jdbc:mysql://localhost:3306/mysql
How to run a servlet
How to Run a Servlet       To run a servlet one should follow the steps illustrated below:  Download... enter. If everything is correct your servlet will run.  ADS
how to run a vlc player in jsp
how to run a vlc player in jsp  how to run a vlc player in jsp
how to run a .exe file in jsp
how to run a .exe file in jsp  i want code for to run a .exe file in jsp
how to run servlet - JSP-Servlet
how to run servlet  pls give me comlete procedure to run the servlet on apache-tomcat 6.0.16 how can i set my classpath, java_home etc. also where i have to save my servlet program and how it compile and then run on web browser
how to run ejb3.0 with jboss4.0.2 - EJB
how to run ejb3.0 with jboss4.0.2  i can install jdk5.0,ant1.7and jboss4.0.2 but i didn't known how run the ejb bean plz help me for my promble
how to run ejb3.0 with jboss4.0.2 - EJB
how to run ejb3.0 with jboss4.0.2  i can install jdk5.0,ant1.7and jboss4.0.2 but i didn't known how run the ejb bean plz help me for my promble
How to run JSP program inEclipse?
How to run JSP program inEclipse?  Hi, I am learning JSP. I want to run JSP in Eclipse. How to run JSP program inEclipse? Thanks   Hi, Its easy to run JSP from the Eclipse. You have to make a dynamic web application
How to find run time in SQL.
How to find run time in SQL.  I have 10 backend jobs in sql which runs at different time intervals. Sample data is shown below Table name:- Job_Run.... (i.e when i run the query it should show me how long job has been running
how to run jsp appication in eclipse
how to run jsp appication in eclipse  after setting the tomcat in eclipse, i m trying to run jsp page, but the pop up has come that "selection did not contain any resources that can run on server". plase tell me i m new to handle
how to compile and run servlet program
how to compile and run servlet program   hello sir/mam i hve installed tomcat5.5 version and also have jdk1.6.0_14 installed but not able to run it or compile i m doing it first tyme pls help me in sorting out this problem. i hve
How to compile and run Java program
How to compile and run Java program  How to compile and Java program from command prompt on my windows 7 computer? Thanks   Hi... is not installed your computer, learn how to install and configure Java on windows 7
How to run external command in Python?
How to run external command in Python?  Hi, I am writing an application in Python and there is requirement of calling the external command from... external command. How to run external command in Python? Thanks   Hi
how to connect mysql with JDBC - JDBC
how to connect mysql with JDBC  I have created three tables in the database MYsql, i have to connect them now using JDBC, can u please suggest me... { connection = DriverManager.getConnection("jdbc:mysql://localhost
JDBC Transaction Example
is the video tutorial which shows you how to run the code example with instruction. How to manage transaction in JDBC? Then Write the Following...JDBC Transaction Example JDBC Transaction  JDBC transaction is used
how to compile and run struts application - Struts
how to compile and run struts application  how to compile and run struts program(ex :actionform,actionclass) from command line or in editplus 3
How to run program in new opened cmd
How to run program in new opened cmd  Hello i have made a program in java to open command prompt, then how to run my left of the program in the new opened command prompt
How to Run First Java Bean Program ?
How to Run First Java Bean Program ?  Hi My Dear Friend I can run... But Now I need that How to run Java Bean Now I have BDK1.1 But still don't know that how run this... I have this bdk dir... \bdk1_1\beans\beanbox
how to deploy and run jsp - JSP-Servlet
how to deploy and run jsp  hi anybody plz tell how to deploy and run... in the root directory . If you run on localhost then in browser file "abc.jsp" deploy in the root directory and run with this URL http://localhost
how to run org.jfree programss - Java Beginners
how to run org.jfree programss  Hi frends, I was trying to run... me how can i solve this problem....... actually i have just installed my java1.4 version and set the class path........ do i need to do any extra thing to run
how to run a java program using run.exec()?
how to run a java program using run.exec()?  Hi..i want to compile and run a java file using run.exec().i.e., without compiling and running from command prompt i want to do them in the program itself.I am able to compile
How to run PHP Script from the command line ?
How to run PHP Script from the command line ?  Running PHP Script from the command line   Actually it is very simple to run php script command line. Except there are a few things that are different, for example
how to run java application with out stoping
how to run java application with out stoping  I have one java application to download some pdf file but its going to stop downloading after some time it not giving any errors any thing can any one help me to solve this problem
How to call the run method from another class?
How to call the run method from another class?  Sorry, if this is a stupid question. I would like to find out how to call the run method... run() { new FereastraPrincipala().setVisible(true); from the class
How to run a simple jsp page in tomcat???
How to run a simple jsp page in tomcat???  i am trying to run a simple jsp page in tomcat,i am having web.xml also in WEB-INF folder...\Tomcat 6.0\lib\servlet-api.jar using this ,i am able to run all servlet programs
How to run a Java program in CMD
There are multiple ways to write and run Java programs. In this article we discussed how to write and run Java program in CMD. Tips to run Java program... Run the dir command to check if the 'HelloWorld.java' exist
how to resolve this JDBC Error?
how to resolve this JDBC Error?  i am trying to Exceute this code: import java.sql.DatabaseMetaData; import java.sql.Connection; import... = "oracle.jdbc.driver.OracleDriver"; String dburl = "jdbc:oracle:oci:@localhost
How to download MySQL JDBC driver?
How to download MySQL JDBC driver?  Hi, What is JDBC Driver? How to download MySQL JDBC driver? Thanks   Hi, JDBC - Java database... program. To connect to MySQL database from Java program we need JDBC Driver of MySQL
how to use dirivers - JDBC
how to use dirivers  i try connecting to a database with this code but i get this ClassNotFoundException, already i have added the path..."); connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root
how to connect jdbc
how to connect jdbc  package com.tcs.ilp.Try.Controller; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import
How to Develop, Compile & Run a rmi Program in NetBeans 6.9.1 ide?
How to Develop, Compile & Run a rmi Program in NetBeans 6.9.1 ide?  how to develop, compile & run a rmi program in netbeans 6.9.1 ide? will you please give me a step by step (practical) explaination? Thanks in advance
how to run audio files in net beans using j2me
how to run audio files in net beans using j2me  i am running the audioMidlet in net beans. Now where should i place the .wav files inorder to play them
How to run java swing application from jar files .
How to run java swing application from jar files .  Hello Sir... setup file .As per my knowledge i have to run .jar file from dist folder of netbeans but when i am trying to run from there i am getting error "Could not find

Ads