?
Solved

Include external text

Posted on 2003-03-19
5
Medium Priority
?
148 Views
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?
0
Comment
Question by:AlexNYC
[X]
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
5 Comments
 
LVL 14

Expert Comment

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

Author Comment

by:AlexNYC
ID: 8169057
What would that code look like?
0
 

Author Comment

by:AlexNYC
ID: 8169092
What would that code look like?
0
 

Author Comment

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

Accepted Solution

by:
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 );
in.close();
String sql = new String( buf );
0

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