user3194262
user3194262

Reputation: 51

Saving particular format of data in mysql

I am entering data in a field called description through a java application.Now my question is that the data that i am entering is aligned(i.e it consist of bullets and numbering and data,there are also spaces)is it possible to save data in mysql in the same format.Because when the same data(description data) is fetched through query the format changes to that of a paragraph which i dont want it to.Basically i want the data to be saved in the same format that it is in excel in mysql.Can this be possible.Can anyone one guide me for this.

From excel sheet one column will contain data in the following format.

TABLE OF CONTENTS

I. INTRODUCTION

Report Scope and Methodology
Executive Summary

II. BUSINESS ENVIRONMENT

Economic Outlook
Key Economic Indicators
Industrial Output
Population and Labor
Foreign Investment
Foreign Trade
Financial and Tax Regulations
Banking System and Regulations
Foreign Exchange
Taxes, Tariff and Custom Duties

III. METHIONINE INDUSTRY ASSESSMENTS

I want data to be saved in this same format so that while i am fetching it i get it in the format as above.

Upvotes: 0

Views: 93

Answers (1)

Jwalin Shah
Jwalin Shah

Reputation: 2521

try to use prepareStatement to execute query and set up values of fields inside that.

For Example,

String insertTableSQL = "INSERT INTO DBUSER"
        + "(USER_ID, USERNAME, CREATED_BY, CREATED_DATE) VALUES"
        + "(?,?,?,?)";
PreparedStatement preparedStatement = dbConnection.prepareStatement(insertTableSQL);
preparedStatement.setInt(1, 11);
preparedStatement.setString(2, "mkyong");
preparedStatement.setString(3, "system");
preparedStatement.setTimestamp(4, getCurrentTimeStamp());
// execute insert SQL stetement
preparedStatement .executeUpdate();

Upvotes: 1

Related Questions