Include external text

Posted on 2003-03-19
Medium Priority
Last Modified: 2013-11-18
I need to start keeping my SQL code in a seperate file.  Traditionaly I have been using:

String SQL = "Select * from People";

But now I need to have some thing like:

String SQL = <jsp:include page="sql/PeopleTable.sql">;

PeopleTable.sql is a text file with line breaks.  Any ideas?
Question by:AlexNYC
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 14

Expert Comment

ID: 8168462
you must write you own file access code, read the file and store it in a string.

Author Comment

ID: 8169057
What would that code look like?

Author Comment

ID: 8169092
What would that code look like?

Author Comment

ID: 8169093
What would that code look like?
LVL 14

Accepted Solution

kennethxu earned 150 total points
ID: 8169181
psudo code:
File file = new File( "file_path_and_name" );
int size = (int) file.length();
byte[] buf = new byte[size];
InputStream in = new FileInputStream( file );
in.read( buf );
String sql = new String( buf );

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question