Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Problem with Double type Value in Access Database

Have Programming Question? Ask it here!
 
 
 


shweta
Problem with Double type Value in Access Database
1 Answer(s)      4 years and 3 months ago
Posted in : Java Beginners


Hello sir I have store Double Type Value in MS Access Databse,but when I search Record then it Gives Round Figure Value related with Percentage and
I want to Store and Retrieve Mobile Number with MS access Database,plz Help Me Sir.

Advertisement
View Answers

April 13, 2010 at 11:36 AM


Hi Friend,

Use rs.getDouble() method to retrieve marks and percentage.

import java.sql.*;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class Test extends JFrame{
public static void main(String[]args){

try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con1 =DriverManager.getConnection("jdbc:odbc:access","","");
Statement stmt=con1.createStatement();
double marks=80.58;
double percent=80.58;
int i=stmt.executeUpdate("insert into student1(marks,percentage) values("+marks+","+percent+")");
JOptionPane.showMessageDialog(null,"Data is successfully inserted into database.");
ResultSet rs=stmt.executeQuery("select * from student1 where id=1");
double m=0;
double p=0;
while (rs.next())
{
m=rs.getDouble("marks");
p=rs.getDouble("percentage");
}
System.out.println(m);
System.out.println(p);


}

catch(Exception e){
System.out.println(e);
}
}
}

Thanks


Related Tutorials/Questions & Answers:
Problem with Double type Value in Access Database - Java Beginners
Problem with Double type Value in Access Database  Hello sir I have store Double Type Value in MS Access Databse,but when I search Record... Mobile Number with MS access Database,plz Help Me Sir.   Hi Friend
code for insert the value from jsp to access database
code for insert the value from jsp to access database  code for insert the value from jsp to access database
Advertisements
how to delete the access database value in jsp
how to delete the access database value in jsp  i loaded my database data into the dropdown list box...now i want to delete the value..plz send the source code to delete the value in dropdown list box and also from database
how to delete the access database value in jsp
how to delete the access database value in jsp  i loaded my database data into the dropdown list box...now i want to delete the value..plz send the source code to delete the value in dropdown list box and also from database
How to Store Float Value into Access Database - Java Beginners
. To store the double value in Access database, you need to set the datatype...How to Store Float Value into Access Database  Hello sir,I want to Store Student Marks Percentage into Access Database in Float Value how i can Store
getting problem in storing & retrieving value in database
getting problem in storing & retrieving value in database  Hello everyone i am doing a project where my back end is ms access & i want to store value like 5353250214 so if i store it as long int in access it wont take it &
Problem with JRadioButton and Access Database - Java Beginners
in Access Databse, I want to store course type in to database and also other fields value . plz help Me. import java.io.*; import java.awt.*; import javax.swing....Problem with JRadioButton and Access Database  Hello sir ,Here I have
Criteria Double Value Compare Example
Criteria Double Value Compare Example In this Example, We will discuss about...;'like' and 'gt'. In This example we compare double data type value in the table. Here is the simple Example code files
how to write to file primitive type double
to file primitive type double in java program? thanks   Hi, To write a file primitive data type double there is a class DataOutputStream that provides a writeDouble() method to write a double value in binary files. writeDouble
Conversion from double to int
a double type value to int type value. Description: This program will take a double value from console and provide the conversion to int type. The line... the mydouble double type value to myint int type data. Code: import java.io.
Conversion from double to short
a double type value to short type value. Description: This program will take a double value from console and provide the conversion to short type... the double type value from console. The line short myshort = (short)(mydouble
Conversion from double to float
a double type value to float type value. Description: This program will take a double value from console and provide the conversion to float type... the double type value from console. The line float myfloat = (float)(mydouble
Conversion from double to char
a double type value to char type value. Description: This program will take a double value from console and provide the conversion to char type. The line... the mydouble double type value to mychar char type data. Code: import
Conversion from double to String
to convert a double type value to String type value. Description: This program will take a double value from console and provide the conversion to String type... the double type value from console. The line String mystring = Double.toString
Conversion from double to long
a double type value to long type value. Description: This program will take a double value from console and provide the conversion to long type. The line... the mydouble double type value to mylong long type data. Code: import
Conversion from double to byte
a double type value to byte type value. Description: This program will take a double value from console and provide the conversion to byte type. The line... the mydouble double type value to mybyte byte type data. Code: import
Conversion from float to double
a float type value to double type value. Description: This program will take a float value from console and provides a conversion to double type data...); converts the myfloat float type value to mydouble double type value. Code
Conversion from long to double
a long type value to double type value. Description: This program will take... the mylong long  type value to mydouble double type value. Code: import... from long type to double type---"); System.out.println("Enter long type value
Conversion from double to boolean
to convert a double type value to boolean type value. Description: This program will take a double value from console and provide the conversion to boolean type... the double type value from console. The line boolean myboolean = (mydouble!=0
Conversion from byte to double
a byte type value to double type value. Description: This program will take a byte value from console and provides a conversion to double type data... the mybyte byte type value to mydouble double type data. Code: import java.io.
Convert String To Double
numeric type string value:" message and it converts into a double... class wraps a value of the primitive type double in an object. Finally, it we get...; In this section, we are going to convert a numeric type string value
How to get the correct value by calculating double values....
How to get the correct value by calculating double values....  Hello... { double min = 60; double cost = 0; double quotient = duration / min; double rem = duration % min; if (rem >= 0
Conversion from int to double
an int type value to double type data. Description: This program will take... to double type data. The line int a = Integer.parseInt(buffreader.readLine()); is used to read the int value from console and stored in a variable. The line double
How to get the correct value by calculating double values....
How to get the correct value by calculating double values....  Hello... { //DecimalFormat df = new DecimalFormat("#.##"); double min = 60; double cost = 0; double quotient = duration / min
Get the capacity of a double type buffer
Get the capacity of a double buffer In this tutorial we will see how to get size of a double buffer using capacity() method. Code: import java.nio.DoubleBuffer; public class 
how to retrieve the id value itself from the access database to drop down listbox in jsp
how to retrieve the id value itself from the access database to drop down... access database to drop down list box in jsp...plz send the code for that.....plz   <%@page import="java.sql.*"%> <select> <option value
Compare two double type buffer's content
Compare two double buffer's content In this tutorial we will see how to create a double buffer and put content into it and then compare double value of one buffer with another. Code: import 
ACCESS DATABASE FROM HTML
ACCESS DATABASE FROM HTML  I want to access sql 2008 database in html page without help of ADODB connection.. because if access through ADODB means there is a security problem. so, Access database in html page(client side
Get the smallest double greater than the given value
a value of double type. Now to determine it, we have invoked the nextDouble() method...Get the smallest double greater than the given value This section demonstrates you how to get the smallest double value greater than the given value. Java
problem in database
problem in database   thanks for web site. I want change this code to insert data into PostgreSql database using jsp,servlets. but i getting...){ out.println("Couldn't load database driver: " + e.getMessage()); } catch
Connect database in Access to Netbean?
Connect database in Access to Netbean?  how to connect database in micrsoft access to Netbean?i know it can be connected by using JDBC-ODBC bridge, can i know the steps in connecting the database? Is there any source code
Type casting the returned value of a method.
Type casting the returned value of a method.  Hi, How do you type cast the returned value of a method so that you can avoid creating a temporary... know that the component returned by panel.getComponent(i) will be of type
Access 2007 database connectivity
Access 2007 database connectivity  i design an application form... source and destination. pls tell me the code of connectivity with access 2007 database using JComboBox.thanks
JSP and Database access
JSP and Database access  Hi, Please help me with the following program. I am not able to update all the pa column values in my database. csea.jsp...;th><%=rs.getString("s_name")%></th> <th><input type
database problem
database problem  I did connect my jsp page to database and it showed the result on another jsp page but i want to show the data of that field on which i click to mouse from the jsp page where all the data field has been showed
database problem
database problem  I did connect my jsp page to database and it showed the result on another jsp page but i want to show the data of that field on which i click to mouse from the jsp page where all the data field has been showed
connecting to access database
Access Driver(*.mdb) Select database name and Create the DSN name (e.g access...connecting to access database  print("code sample");Hi I Write java... this there is no error but my data is not going to my Acess Database. There is working
how to access database in applet
how to access database in applet  HI... I'm having an applet where we should display the database values in the applet... It works fine in the local...("type"); connName = getParameter("name"); query = getParameter("qry
Problem in accessing data from Database
Problem in accessing data from Database  hi..... i'm making a project on servlet and jsp with ms access 2007 at the backend. One field in my database is text and all others are of currency data type. If i enter 0 or null value
MySQL Column Type Database
MySQL Column Type Database     ... type (char) database. MySQL Numeric type and String type Database :   TYPE BYTE  MINIMUM VALUE MAXIMUM VALUE
Conversion from short to double
a short type value from console and provides a conversion to double type. The line... type to double type---"); System.out.println("Enter short type value...; System.out.println("Converted value from short type to double type is : " + mydouble
Wraps a double type array into a buffer
Wraps a double type array into a buffer In this tutorial you will see how to wraps a double array into a buffer. The public static DoubleBuffer wrap(double[] array) method allow double array to wrap it into a buffer. Code
link hibernate to MS ACCESS database
link hibernate to MS ACCESS database  how to link hibernate to ms access database instead of sql database
Applet database access - Applet
Applet database access  HI... I'm having an applet where we should display the database values in the applet... It works fine in the local system... but when its in the server, we r getting null values in the local system.. I
how to access the MS ACCESS database with java
how to access the MS ACCESS database with java   how to access the MS ACCESS database with java how can we insert,delete,update,search records of ms access with java   Java MS Access database connectivity Follow
problem in jsp using ms-access
problem in jsp using ms-access  after starting server(tomcat) wen v... and select the driver Microsoft Access Driver(*.mdb). 3)After selecting... the driver Microsoft Access Driver(*.mdb). 3)After selecting the driver, click
java servlet connectivity problem with access
java servlet connectivity problem with access  Import java.sql javax.servlet //all packages entered try { Class.forName...=con.createStatement(); ^ i am confused what is the problem
MS-ACCESS Query Problem - SQL
MS-ACCESS Query Problem  hi sir i have table which is initially have empty records Deleted Attributes: Roll Name Add Age Course Class... = DriverManager.getConnection("jdbc:odbc:access"); Statement st
Conversion from String to double
double type value. The parseDouble() method coverts any type data to double type... to convert a string type data to double type data. Description: This program will take a String value from mystring variable. The line double mydouble
Subtract a value in the database from java
Subtract a value in the database from java   Hi, i want to know how to subtract a value on a database. im using JDBC connection from access and i want to decrement the value of table "quantity" of 1 each time it passes a loop my
Advertisements
 

 

 

DMCA.com