N
N
Nikolay Baranenko2016-06-10 12:16:32
Java
Nikolay Baranenko, 2016-06-10 12:16:32

Is there a csvjdbc-1.0-29 CSV JDBC driver option that would disable .CSV prepending in select?

Hello.

JDBC driver for connecting to CSV - csvjdbc-1.0-29 appends to Query .CSV and returns
as result
select * from example .CSV

Is there a setting to disable this?

try {

 	    Class.forName("org.relique.jdbc.csv.CsvDriver");
        } catch (ClassNotFoundException e) {
            out.println("<h1>Driver not found:" + e + e.getMessage() + "</h1>" );
        }
  try {
        // прописывание свойств разделителей
        Properties props = new java.util.Properties();
        props.put("separator", ";");
      Connection conn = DriverManager.getConnection ("jdbc:relique:csv:E:\\DataBases\\CSV\\", props);

            Statement stmt = conn.createStatement();
            ResultSet rs;

            rs = stmt.executeQuery("select * from example");
      out.println( "<table border=1>" );
            while ( rs.next() ) {
                String num = rs.getString("num");
                String solution = rs.getString("solution");
                out.println("<tr><td>"+num+"</td><td>"+
        solution+"</td></tr>" );
            }
      out.println( "</table>" );

            conn.close();
        } catch (Exception e) {
            out.println( "<h1>exception: "+e+e.getMessage()+"</h1>" );
        }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikolay Baranenko, 2016-06-10
@drno-reg

solved the problem
props.put("fileExtention","");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question