Share on Google+Share on Google+

Jatish Khanna
SQL or UNICODE
2 Answer(s)      7 years ago
Posted in : SQL
Hi again............

I have got something new that...........

i was using MS Access as the database with my JAVA Japplet....

In my applet i used JTextArea to display the output .....
The output to display is fetched from the database which is connected using DSNless connection as with connection string...

My database contains two columns one with having ASCII and other With UNICODE

1]
when i trying to pass parameter to database i.e UNICODE and fetches ASCII it retrieves nothing to display

2]

when trying to pass parameter ASCII and fetches UNICODE it retrieves only [????] but exactly the same number of chars stored in DATABASE.......

acc. to me their is problem in SENDING and Retrieving the database bcz when trying to fetched ASCII it fetches the exact match and displays......

but with UNICODE nothing ......

I had also change my backhand to SQL SERVER but retrieves same for UNICODE [????] ..............

thanks
waiting for reply

Ads

View Answers

April 19, 2010 at 1:20 PM


Hi Friend,

In Access database, declare the data type 'Text' to both the fields.
You can use the following code to fetch the UNICODE value.

import java.sql.*;
import java.util.*;
class MSAccess{
public static void main(String[] args) {
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:access");
Scanner input=new Scanner(System.in);
System.out.println("Enter Ascii value: ");
String ascii=input.nextLine();
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select UNICODE from Data1 where ASCII='"+ascii+"'");
if(rs.next()){
System.out.println(rs.getString("UNICODE"));
}
}
catch(Exception e){}
}
}

Hope that it will be helpful for you.
Thanks









Related Tutorials/Questions & Answers:
SQL or UNICODE - SQL
SQL or UNICODE   Hi again............ I have got something new... ...... I had also change my backhand to SQL SERVER but retrieves same for UNICODE... ASCII and other With UNICODE 1] when i trying to pass parameter to database i.e
UNICODE or SQL statement issue - JDBC
UNICODE or SQL statement issue  Hi again............ I have got... with having ASCII and other With UNICODE 1] when i trying to pass parameter to database i.e UNICODE and fetches ASCII it retrieves nothing to display 2
Advertisements
Unicode - JDBC
Unicode  hi i wanna retrieve Unicode values from the database...) or IN doc or RTF or WEB page it get the UNICODE as ????? what can i do so Language JAVA platform XP database SQL Server and MS ACcess
Java Unicode
Java Unicode  To insert Unicode word into MySql database using Java
Java Unicode
Java Unicode  To insert Unicode word into MySql database using Java
unicode characters
unicode characters  class Unicode { public static void main(String args[]) { char ch='\000a'; System.out.println("ch is:"+ch); } } on compilation this gives following errore:: CharLiteral6.java:5: error: illegal line end
unicode characters
unicode characters  class Unicode { public static void main(String args[]) { char ch='\000a'; System.out.println("ch is:"+ch); } } on compilation this gives following errore:: CharLiteral6.java:5: error: illegal line end
unicode characters
unicode characters  class Unicode { public static void main(String args[]) { char ch='\000a'; System.out.println("ch is:"+ch); } } on compilation this gives following errore:: CharLiteral6.java:5: error: illegal line end
unicode - Swing AWT
unicode  hi i wanna retrieve Unicode values from the database...) or IN doc or RTF or WEB page it get the UNICODE as ????? what can i do so Language JAVA platform XP database SQL Server and MS ACcess
unicode handling in java
unicode handling in java  reading a unicode text file in java
PDF Generation for unicode characters
PDF Generation for unicode characters  Hi, How a PDF file having unicode characters is generated in JSP
Java unicode - Java Beginners
Java unicode  I can read unicode character(malayalam language character) from a file but not able to print the character without installing a malayalam font(corresponding language font). Please help me to solve
Unicode - Java Beginners
Unicode  How to print unicode value of a char. Eg. /u0000 on console(default value of a char)  Hi Friend, Try the following code: import java.io.*; import java.util.*; public class Unicode { public static
Prinnt UNICODE character on swing component
Prinnt UNICODE character on swing component  Hello, I am trying to put unicode character n swing component. can anyone tell me how to do this? Thank you
How java work on Unicode machanish
How java work on Unicode machanish   How the data are stored in java as unicode, how the conversions is done for input/output stream. Please describe in detail with memory aspect
Unicode - Java Beginners
SQL SERVER 2005) So please give me a proper solution fixed this issue
Conversion of unicode to its corresponding character
Conversion of unicode to its corresponding character  i have a string of unicodes e.g String s="\c0059\c0049\c3000" .. i need code for converting these unicodes to its corresponding alphabets.. pls if possible rep asap as i need
unicode support in javascript - JSP-Servlet
unicode support in javascript  We are facing problem while editing the tha text in a text box and sending it to next jsp. we are using UTF-8 encoding for jsp and charset as windows-874 for html meta charset. Can anybody help me
Convert String to unicode and ascii
Description: This example demonstrate how to convert the general string to unicode and ascii type Code: import java.net.IDN...; + unicode);   } } Output
How to get the unicode of chinese character input in j2me/java
How to get the unicode of chinese character input in j2me/java  Hi All, How to get the Unicode of a chinese character either in j2me or Java? Please provide the sample code snippet for the above ? Thanks in advance... Thanks
How to get the unicode of japanese character input in java
How to get the unicode of japanese character input in java  Good... the text into japanese that needS to be converted as a unicode. for that I need a function,method or something through which i can get the unicode of japanese
unicode conversion to its actual text format
unicode conversion to its actual text format  hi, i am saving the hindi text into the database. It is saving in db as "हिन्डि". But while fetching i am not able to fetch the same hindi text
sql
difference between sql and oracle  what is the difference between sql and oracle
sql
sql  how to get first row in sql with using where condition in sql? how to get last row in sql with using where condition in sql
Generate unicode malayalam PDF from JSP
Generate unicode malayalam PDF from JSP   Hi, I want to generate... the same report to be saved as PDF in unicode malayalam font.I have tried to generate PDF reports using IText,but I dont know how to generate unicode malayalam
sql
sql  I want interview sql questions   Please visit the following link: SQL Tutorials
Determining the Word Boundaries in a Unicode String
Determining the Word Boundaries in a Unicode String In this section, you will learn how to determine the word boundaries in a unicode string. Generally, we use split() method and StringTokenizer class to break the string into words
Sql
Sql  how to find maximum of a101,a102,a103 from a table in sql
SQL
SQL  hii What is sql?   hello, SQL, which stands for Structured Query Language, is a special-purpose language used to define, access, and manipulate data. SQL is non procedural, meaning that it describes
Tutorials   
Java Spring Hibernate Struts Training How to Fetch Data using dropdown option How to get day from date in SQL? Example of sorting results in MySQL Distinct and Limit example in MySQL How to download install and use MySQL workbench? Example of Average, Sum, Min and Max functions in MySQL How to delete data from MySQL? Update SQL Query Example Order by example in MySQL AND and OR Operators in MySQL Query Where clause with query in MySQL How to use select Statement in MySQL? How to insert data into MySQL Table? Create Database and tables in MySQL example of before insert trigger in mysql Failed to Call Procedure MY Sql Query Error - Not able to Understand the issue which query will be run for previous(button) question How to access data yearly from DB in C# ? Fastest way to upload huge raw data in database - c#, Java or stored procedure DB Insert Nb hours between 2 time stamps meets specific criteria mysql select into table from another table example MySQLselect into new table Example code How to create a .mdf file from script (.sql) Please help me out fixing broken relational links in MySQL database after an upgrade How do I upgrade mysql? mysql 4.x to 5.x upgrade problem Upgrading a PHP/MYSQL application? upgrading sql query join phpmyadmin in whm whm php version update php cpanel cpanel mysql downgrade cpanel mysql version upgrade mysql whm upgrade mysql 4 5 cpanel upgrade mysql cpanel server Did my upgrade from mySQL 5.1 to 5.5 work Upgrade to MySQL 5.5 ? - cPanel Mem use upgrade from MySQL 5.1 to 5.5 - cPanel Upgrading MySQL from 5.0 to 5.1 or 5.5 - cPanel Mysql Upgrade on WHM (Mysql 5.1 to 5.5)cPanel Mysql Upgrade on WHM (Mysql 5.1 to 5.5) - cPanel Updating from MySQL 5.0 to 5.5 cPanel MySQL 5.1 upgrade to 5.5 error Charset problem upon publishing PHP + MySQL website MySQL issue: Table 'data_dictionary.CHARACTER_SETS' doesn't exist SQL Error Version 5.5.15

Ads

 
Advertisement null

Ads