Advertisement
Guest User

Untitled

a guest
Jun 9th, 2017
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. % Set preferences with setdbprefs.
  2. s.DataReturnFormat = 'cellarray';
  3. s.ErrorHandling = 'store';
  4. s.NullNumberRead = 'NaN';
  5. s.NullNumberWrite = 'NaN';
  6. s.NullStringRead = 'null';
  7. s.NullStringWrite = 'null';
  8. s.JDBCDataSourceFile = 'C:\Users\lakshmiyeswanth\Desktop\grey algos\database_mfiles_20070321\dbcon.mat';
  9. s.UseRegistryForSources = 'yes';
  10. s.TempDirForRegistryOutput = '';
  11. setdbprefs(s)
  12.  
  13. % Make connection to database. Note that the password has been omitted.
  14. % Using JDBC driver.
  15. conn = database('test','scott','password','oracle.jdbc.driver.OracleDriver','jdbc:oracle:thin:');
  16.  
  17. % Read data from database.
  18. e = exec(conn,'SELECT ALL JOB FROM SCOTT.EMP');
  19. e = fetch(e);
  20. close(e)
  21.  
  22. % Close database connection.
  23. close(conn)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement