Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java in General
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Java in General
Struts 1.2 - To Store Unicode data into database
vrushali chaskar
Greenhorn
Posts: 14
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
I m using
Struts
1.2 ,mysql and
JBOSS
.
How i able to insert Unicode (Marathi) into database through Action Class?
Alaa Nassef
Ranch Hand
Posts: 471
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I believe that this would be more appropriate in the
struts forum
, don't you think?
Visit my blog:
http://jnassef.blogspot.com/
Arpit Purohit
Greenhorn
Posts: 21
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Do
Inserting Unicode Data into Database
has anything to do with Struts Action class???
Any way....here is the sample code to insert unicode data into mysql using
JDBC
:
// Set up Properties Properties pr = new Properties(); pr.put("user", "xxxxx"); pr.put("password", "xxxxx"); pr.put("characterEncoding", "utf-8"); pr.put("useUnicode", "true"); // Establish connection to database Class.forName("com.mysql.jdbc.Driver").newInstance(); Connection connection = DriverManager.getConnection("jdbc:mysql://localhost/mydatabase", pr); Statement statement = connection.createStatement(); // Insert data into database statement.executeUpdate("insert into mytable (username) values (\"" + request.getParameter("username") + "\")"); // Close open connections statement.close(); connection.close();
This can be used any where for the desired functionality.
Regards,
Arpit Purohit
Jaikiran Pai
Sheriff
Posts: 10445
227
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Doesn't look like either
EJB
related or Struts related. Moving to
Java
in General.
[
My Blog
] [
JavaRanch Journal
]
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Using struts 1.2 how to upload a file into database and download it
database connectivity
Struts 1.2 - To Store Unicode data into database
Basic jars and Plugins to run struts application
Action class in Struts
More...