~team-java-connector/mariadb-java-client/mariadb_java_connector_1.1.7

« back to all changes in this revision

Viewing changes to src/main/java/org/mariadb/jdbc/internal/common/query/parameters/StringParameter.java

  • Committer: Puneet Dewan
  • Date: 2014-05-22 21:11:43 UTC
  • Revision ID: puneetd30@gmail.com-20140522211143-fk6no51e4berop92
Original code version 1.1.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
MariaDB Client for Java
 
3
 
 
4
Copyright (c) 2012 Monty Program Ab.
 
5
 
 
6
This library is free software; you can redistribute it and/or modify it under
 
7
the terms of the GNU Lesser General Public License as published by the Free
 
8
Software Foundation; either version 2.1 of the License, or (at your option)
 
9
any later version.
 
10
 
 
11
This library is distributed in the hope that it will be useful, but
 
12
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
13
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
 
14
for more details.
 
15
 
 
16
You should have received a copy of the GNU Lesser General Public License along
 
17
with this library; if not, write to Monty Program Ab info@montyprogram.com.
 
18
 
 
19
This particular MariaDB Client for Java file is work
 
20
derived from a Drizzle-JDBC. Drizzle-JDBC file which is covered by subject to
 
21
the following copyright and notice provisions:
 
22
 
 
23
Copyright (c) 2009-2011, Marcus Eriksson
 
24
 
 
25
Redistribution and use in source and binary forms, with or without modification,
 
26
are permitted provided that the following conditions are met:
 
27
Redistributions of source code must retain the above copyright notice, this list
 
28
of conditions and the following disclaimer.
 
29
 
 
30
Redistributions in binary form must reproduce the above copyright notice, this
 
31
list of conditions and the following disclaimer in the documentation and/or
 
32
other materials provided with the distribution.
 
33
 
 
34
Neither the name of the driver nor the names of its contributors may not be
 
35
used to endorse or promote products derived from this software without specific
 
36
prior written permission.
 
37
 
 
38
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS  AND CONTRIBUTORS "AS IS"
 
39
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 
40
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 
41
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
 
42
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 
43
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 
44
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 
45
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 
46
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
 
47
OF SUCH DAMAGE.
 
48
*/
 
49
 
 
50
package org.mariadb.jdbc.internal.common.query.parameters;
 
51
 
 
52
import java.io.IOException;
 
53
import java.io.OutputStream;
 
54
 
 
55
 
 
56
public class StringParameter extends ParameterHolder {
 
57
    String s;
 
58
    boolean noBackslashEscapes;
 
59
 
 
60
    public StringParameter(String s, boolean noBackslashEscapes) {
 
61
        this.s = s;
 
62
        this.noBackslashEscapes = noBackslashEscapes;
 
63
    }
 
64
    public void writeTo(final OutputStream os) throws IOException {
 
65
        ParameterWriter.write(os, s, noBackslashEscapes);
 
66
    }
 
67
}